Repository navigation
Description
Found while verifying the tri-comparison yaml func-precision cell (gg-only, currently 0/123) for #3276.
Symptom
yaml's function extraction under-counts CI steps whenever a step contains a multi-line |/> block scalar (e.g. a run: | shell block or a github-script with:\n script: | JS block). The Mode C indentation slicer's dedent detection is broken by the block scalar's embedded, arbitrarily-indented content, so one spurious unit runs to EOF and swallows every following step.
Confirmed repro — language-crucible/data/yaml/vscode_workflows/api-proposal-version-check.yml
func_start(raw signal) matches 7 step keys;function_count(named units) = 3 — 4 real steps dropped.- The 3 named units and their spans:
Get PR infoL36, loc 26 → L62Check for override commentL63, loc 60 → L123scriptL135, loc 163 → L298 (EOF) ← spurious unit spanning the rest of the file
- The 4 dropped are genuine script-running steps:
Pass on override comment(L168,run: |),Check for version changes(L181,run: |),Post warning comment(L242),Fail if version changed without override(L293).
Root cause (two intertwined)
- Prism does not shield yaml block scalars.
|/>block content is opaque literal data (shell/JS), but it reaches Mode C's indentation/dedent logic as if it were structure. There is already a literal-shield mechanism for lua long-brackets (Lua: polyglot segmentation splits a function when a [[ ]] long string contains embedded HTML/CSS/JS #2440) and groovy"""strings (_apply_literal_shield/derive_literal_gate); yaml|/>blocks have no equivalent. func_start's barescript:branch matches a github-scriptwith:\n script:action input (L135), not a top-level step — which is what seeds the runaway unit.
Impact
yaml func recall silently under-counts on any workflow with an embedded multi-line script block. It also blocks a clean manual-verification of the yaml precision cell (the named count is not the true step count), so that tri-comparison cell stays honestly 0/123 until this is fixed. Same defect class the groovy """-leak fix resolved.
Suggested fix
Shield yaml |/> block-scalar content in prism.py (a block scalar owns every line more-indented than its key line, until the first line at ≤ the key's indentation), reusing the existing literal-shield path so Mode C slices on real step structure only; and tighten func_start so a script: under a with: action input is not counted as a step. Re-bless both golden masters; then manual-verify the yaml precision cell.
Activity