Classify simple prompt requirement branches

This commit is contained in:
2026-10-08 20:31:45 +00:00
parent cc0b6183bf
commit 93e8874813
4 changed files with 570 additions and 51 deletions

View File

@@ -60,11 +60,20 @@ cover resource origins, context containment, capture, and selection.
The `internal/prompt` requirement walker uses the captured parse trees and
declaration metadata without executing templates or reading artifacts. It
collects literal `input` names, direct root caller keys, and literal-key
`index` lookups. Branch-body references are conservatively conditional until
condition analysis is applied; invoked named templates are scanned
conservatively, and dependency-bearing range scopes make discovery incomplete.
Uncalled definitions and bypassed session templates are not traversed. This
internal walker does not change rendering behavior.
`index` lookups. For `if` and `with`, it classifies branches when their
conditions are simple supported values: direct values, literals, negation, or
two-string equality/inequality. It uses Go template truthiness, so a supplied
nonempty string such as `false` is true. Missing decision values and
content-dependent conditions leave dependency-bearing branches conditional
and report incomplete discovery; unresolved conditions with no branch
dependencies do not by themselves make discovery incomplete. Recognizable
references on known skipped paths remain optional inventory entries with an
inactive-use explanation, unless another applicable use establishes a
stronger classification. Skipped expressions are scanned only for
syntactically recognizable names and are not evaluated. Invoked named
templates are scanned conservatively, and dependency-bearing range scopes make
discovery incomplete. Uncalled definitions and bypassed session templates are
not traversed. This internal walker does not change rendering behavior.
## Profiles And Built-Ins

View File

@@ -270,6 +270,10 @@ Run `go test ./internal/prompt ./internal/domain`; commit.
## Stage 3 — Classify Simple Branches And Inactive References
**Status: Complete (2026-10-08).** Supported `if`/`with` conditions classify
selected paths, while recognizable skipped-path references remain optional
inventory entries without introducing uncertainty.
**Outcome:** Ordinary supplied-context branches give useful classifications;
inactive inputs and variables remain optional inventory.