docs(885): a condition NAMES a secret without exporting it, and is faulted for naming it

The `if:` clause reads the one site whose reference the evaluator resolves without
materialising anything into the job environment, so a reader can reasonably ask why it
faults. Both the function and the record now say: the predicate is "names a stored secret",
never "exports one" — on the head-authored route the contributor picks the comparison, which
makes a condition an oracle over the value, and a predicate about exposure would have to
model what each site does with its reference and give up the structure-blindness that saw
`toolchain-preflight`'s step `env:` when a `container:`-shaped predicate did not.

Decisions-Edit: yes
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QqCpYFsKgnAnx6jVwrKiV
This commit is contained in:
2026-09-05 15:15:43 +02:00
co-authored by Claude Fable 5.1
parent 786d1c3c4b
commit d793342f50
2 changed files with 16 additions and 1 deletions
@@ -96,7 +96,13 @@ as ONE span, with `${{` and `}}` replaced by a SPACE rather than deleted, since
collapses `${{ secrets.A }}${{ secrets.B }}` into the single identifier `secrets.Asecrets` and loses
a reference. Everywhere else the scoping stands and the English sentence above still costs nothing.
The cost is named here rather than left implicit in the code, because "the scoping costs no real
spelling" is the reading a narrower note invites, and it is false in exactly this one place.
spelling" is the reading a narrower note invites, and it is false in exactly this one place. A
condition is also the one site where a named secret is not materialised into the environment — the
evaluator resolves it and the job sees a boolean — and it faults anyway, because the predicate is
"names a stored secret" and never "exports one": on this route the contributor picks the comparison,
which makes the condition an oracle over the value, and a predicate about EXPOSURE would have to
model what each site does with the reference and give up the structure-blindness that saw
`toolchain-preflight`'s step `env:`.
**Exhaustive over the EXPRESSION grammar is still not exhaustive over the document.** Reading every
expression, wrapped or bare, leaves one handover the collector cannot see by construction:
@@ -449,6 +449,15 @@ def condition_refs(condition: str) -> list[str]:
read as the bare one, and a fully wrapped condition still counts each reference exactly once.
This is strictly more demanding than `secret_refs` on the same string and never less: an `if:` is
never prose, so the over-match the span scoping exists to avoid cannot arise here.
WHAT AN `if:` REFERENCE COSTS DIFFERS FROM EVERY OTHER SITE THIS GUARD READS, and it is faulted
anyway. A secret in an `env:` or a `run:` is materialised into the job environment; a secret in a
condition is resolved by the evaluator and the job sees only the boolean. The predicate here is
"names a stored secret", never "exports one" — on the head-authored route a condition comparing a
secret to a literal the contributor chooses is an oracle over its value, and a predicate that
asked about EXPOSURE would have to model what each site does with the reference, which is the
structure-blindness this collector deliberately does not give up (it is what saw
`toolchain-preflight`'s step `env:` when a `container:`-shaped predicate did not).
"""
return _refs_in_expression(_EXPRESSION_DELIMITER.sub(" ", condition))