Memoize flag alias resolution by context

This commit is contained in:
2026-11-07 15:54:36 +00:00
parent 02cd49d6b6
commit 0d3f7299cc
4 changed files with 73 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
# Consolidated audit catalog
Status: **12 distinct open findings: 12 P3**, consolidated from 30
Status: **11 distinct open findings: 11 P3**, consolidated from 30
numbered entries in seven audit documents. Reviewed audit state:
`db732e3a1de55c844f77870e1c6db683c2685d5d`.
@@ -274,6 +274,10 @@ ownership; it is separate from the closed-reporting-handle retention in F07.
## F13 — P3: Flag-alias compilation repeatedly walks shared chain suffixes
**Complete.** Each effective context memoizes its target resolutions, including
inactive endpoints, while retaining canonical precedence and cycle diagnostics.
Focused alias and discovery tests pass, including shared suffixes and registration.
For A chained effective flag mappings across C contexts, independent target
walks can perform Θ(CA²) target examinations, including inactive chains. Each
source repeats work already performed for another source's suffix.

View File

@@ -1,6 +1,6 @@
# Audit remediation implementation plan
Status: in progress; Stages 1–14 complete.
Status: in progress; Stages 1–15 complete.
Baseline: `d492c7747175c01a53261206c2b4356e53453621`. Before this sprint,
intervening changes recorded decisions and retired the completed older
@@ -500,6 +500,12 @@ clear, with selected syntax and provenance preserved.
## Stage 15 — Memoize each context's flag-alias graph
**Complete.** Context-local traversal memoizes canonical and unavailable
endpoints, with an active stack for cycle diagnostics. Source review confirms
resolved suffixes are reused within each context. Focused alias, registration,
cycle and discovery tests passed offline with Go 1.27.0 and `-mod=readonly`,
including shared suffixes and unavailable destinations.
Findings: F13. Source: `flag_aliases.go`.
1. Replace independent suffix walks with context-local visitation and memoized