Repository navigation
Description
Update: the lexical-delimiter checklist item originally in this issue (_line_anchor/_inline_comment/_block_start/_block_end) has been removed -- those 4 rule keys are dead config, never read anywhere in gitgalaxy/ (confirmed via grep -rn across the whole package). The real comment-stripping engine (prism.py's _strip_segment_comments) dispatches purely on lexical_family against a separate family-level table in gitgalaxy_config.py. See the epic (#518) for the new issue tracking that real gap instead.
Part of #518.
Language: yaml
- Lexical family:
line_exclusive - Extensions:
.yml,.yaml,.yamllint - 31 of the baseline structural signatures are defined (non-
None) for this language ingitgalaxy/standards/language_standards.py.
Reference
gitgalaxy/standards/how_to_add_a_language.md is the canonical doc for what each signature is supposed to capture/exclude, the 5 lexical parsing families, and (recently added) the AI/ML and literate-programming extension packs. Read the INCLUDES/EXCLUDES wording there for any signature before writing its test -- the one-line descriptions below are a quick-reference copy, not the full spec.
A rule being None here is not a gap
Only write tests for the checklist below. If a signature isn't in this language's rules dict, or is explicitly None, that's an intentional "doesn't apply to this language" per the doc's Strict Feature Parity rule (#4) -- don't invent a synthetic match for it just to have a test.
Lexical family note: This language's lexical family is line_exclusive -- there is no native multi-line block syntax; confirm the engine correctly ignores stray closing tokens rather than treating them as real block terminators.
Checklist (this language's non-None structural signatures)
Phase 1: Logic Topology & Structure
-
branch-- Control flow that forces a decision or jump: if, else, switch, for, while, catch, try, &&, ||, ternary. -
args-- Parameter blocks of functions, methods, and lambdas. Must safely step over type hints and generics without ReDoS. -
structural_boundaries-- Keywords defining structural boundaries and straight-line execution: var, return, class, import. -
func_start-- Exact syntax anchoring the start of an executable block of logic: method signatures, constructors. -
class_start-- The syntax defining an object-oriented class, struct, or record.
Phase 2: Safety & Execution Risk
-
safety-- Defensive programming constructs that prevent crashes at runtime: try/catch, explicit null checks, guard. -
safety_bypasses-- Syntax that actively bypasses type safety, swallows errors, or relies on unpredictable state: force unwrapping (!), any, raw memory casting, linter bypasses (@ts-ignore). -
high_risk_execution-- Process-killing commands and catastrophic runtime vulnerabilities: eval, exec, process.exit. -
io-- Interaction with disk, network, or external systems: file reading/writing, HTTP clients, sockets. -
api-- Code exposed to the outside world. Captures explicit visibility markers (export, public) AND implicit architectural defaults for implicitly-public languages (Python, Fortran). -
state_mutation-- Reassignment of variables or modifying collections: let, mut, volatile, .push(), .set(). -
dead_code-- Commented-out structural code and unused logic trails: // if (x), /* var y */. -
doc-- Structured documentation meant to be parsed by IDEs or generators: JSDoc, docstrings. -
test-- Assertions and unit testing framework keywords: describe, it, assert, expect.
Phase 3: Architecture & Domain Sensors
-
concurrency-- Asynchronous logic and parallel execution: async, await, Promise, Thread. -
globals-- Accessing global state, environment variables, or system registries: window., process.env. -
reflection_metaprogramming-- Metaprogramming, reflection, and dynamic property assignment: Reflection, Proxy, .bind(). -
import-- Dependency resolution and module loading (import, require, using), plus the paired capture-group rule that extracts the exact dependency path string for the dependency graph.
Phase 4: Specialized Sub-systems
-
planned_debt-- Annotated future work: TODO, WIP, STUB. -
fragile_debt-- Explicit admissions of fragile or dangerous logic: HACK, FIXME, XXX. -
events-- Event-driven architecture signatures and message brokers: emit, EventEmitter, Kafka. -
dependency_injection-- Inversion of Control (IoC) injection markers: @Autowired, @Inject.
Phase 5: Resource Management & Stability
-
telemetry-- Structured logging and observability frameworks. -
debug_prints-- Ad-hoc, temporary debug statements: print(, console.log(. -
panics_and_aborts-- Forcefully destroying the current execution context: throw, raise, panic!, abort(). -
thread_sleeps-- Thread blocking or forced timeouts: sleep(, delay(. -
immutability_locks-- Explicitly locking data so it cannot be mutated: const, final, readonly. -
listeners-- Waiting to receive state from an external broadcast: on(, addEventListener, subscribe(. -
test_skip-- Bypassed tests or ignored verification specs: @ignore, test.skip(.
Test template
For each checked signature: (1) a positive-match test against its documented includes, capturing exact group text where applicable; (2) a negative-match test against its documented excludes; (3) any cross-rule ambiguity check flagged above; (4) a ReDoS immunity test (reuse assert_redos_immune from tests/core_engine/test_language_standards_strict.py) sized to this rule's actual quantifiers. Group multiple signatures that share the same simple pattern into one parametrized test rather than writing near-duplicates -- don't force one test per key if several are trivially similar for this language.
New tests land in tests/core_engine/test_language_standards_strict.py, the existing home for this style of test.
Activity
squid-protocol commentedon Jul 28, 2026
Reopening. The closing PR (#681) explicitly skipped the golden crucible verification step:
This wasn't just a missed checkbox -- it turned out to matter. While investigating a related bug (#691, markdown's structural signatures never being counted in a real scan), I found
yamlsits in the exact samedetector.py"Prose Deflection" gate that was blocking markdown:This gate discards
equations(and therefore every structural signature) beforecoding_analysisever runs -- for every yaml file, unconditionally, regardless ofcode_streamcontent. Unlike markdown, yaml'scode_streamis actually populated correctly (confirmed via directPrism.split_streams()execution -- yaml doesn't go throughprism.py's Prose Bypass), so the 5 real regex bugs #681 fixed (high_risk_execution'srm -rf /boundary bug,test_skip's--passWithNoTestsboundary bug,events'schedule:anchor bug,telemetry's::warning::anchor bug, and thereflection_metaprogrammingReDoS) are all correct fixes -- they've just never been exercised in a real scan, because this gate has been silently discarding yaml's results the entire time. Confirmed by callingcoding_analysis()directly (bypassing only the gate) against a realistic sample containing several of these exact constructs -- it correctly fireshigh_risk_execution,events,telemetry, etc.Since #681's unit-level tests (
test_language_standards_strict.py) call the regexes directly againstLANGUAGE_DEFINITIONS["yaml"]["rules"], bypassingdetector.pyentirely, they had no way to catch this -- it's a pipeline-level bug, not a regex-level one, same category as #691.What's needed to close this properly:
pytest -m golden_cruciblein both full-precision and zero-dependency venvs, and the diff should be walked through and explained file-by-file (perhow_to_add_a_language.md's Step 5), not just checked for a clean pass/fail -- given the gate fix will likely produce real, previously-invisible diffs on every yaml file in the corpus, similar in shape to what Prose-bypass languages (markdown, plus yaml/json/csv/plaintext) never get their structural signatures counted, regardless of regex correctness #691/Let markdown's structural signatures reach the detector output #692 produced for markdown.Leaving open until that verification actually happens.
Let yaml/json/csv structural signatures reach the detector output (is…
squid-protocol commentedon Jul 28, 2026
Verification results: 4 of 5 confirmed working end-to-end, 1 blocked by a newly-found separate bug
#694/#695(the pipeline gate fix) is merged. Verified on the mergedmain:pytest -m golden_cruciblepasses cleanly in both full-precision and zero-dependency venvs. But this is not proof that #681's specific fixes work -- I checked, and none of the 7 yaml files in the crucible corpus (all Ansible playbooks/tasks) happen to containrm -rf /,schedule:,::warning::, or--passWithNoTests/--no-auditanywhere. The clean pass reflects absence of those constructs in this corpus sample, not confirmation they're detected -- so I verified directly instead, via a realistic GitHub Actions workflow sample exercising all 5 fixes against the real, merged pipeline:high_risk_execution(rm -rf /) -- fires correctlyevents(schedule:) -- fires correctlytelemetry(::warning::) -- fires correctlyreflection_metaprogrammingReDoS bound -- still immune (0.006s on a 120k-char adversarial payload)test_skip(--passWithNoTests) -- still does not fire, but not because of anything Strict parsing tests:yamlstructural signatures #617/Strict tests for yaml, fix 5 real bugs (1 ReDoS) #681/Detector's Prose Deflection gate wrongly treats yaml/json/csv like markdown/plaintext -- structural signatures never counted for any of the three #694 got wrongTraced the
test_skipfailure to a new, separate, and more severe bug: filed as #697.prism.py's_strip_single_line_comments()-- the function everyline_exclusive-family language (22 of them, including already-closedpython/shell/ruby/perl) routes through -- hardcodes#|--|;|//as its comment-marker pattern, completely ignoring the real per-family delimiter config (which forline_exclusivedoesn't include--at all). Any line containing a literal--anywhere gets everything from that point on silently discarded as a "comment" before it ever reaches a structural-signature regex.run: npm test -- --passWithNoTestsbecomesrun: npm testincode_stream-- thetest_skipregex is correct, it just never sees its own target text.This is a bigger, separate fix (#697) -- not something to bundle into closing this issue.
Leaving #617 open until #697 lands and
test_skipcan be verified the same way as the other 4. Once that's confirmed, this is ready to close for real.Use line_exclusive's real delimiter list instead of a hardcoded guess…
squid-protocol commentedon Jul 29, 2026
Verification complete: all 5 fixes confirmed working end-to-end, ready to close
#697/#698 (the
prism.py---truncation fix) merged 2026-07-28. Re-ran the same end-to-endverification as before, now against the fully-merged pipeline.
Real pipeline test (a small standalone repo scanned with
galaxyscope, not just the unitregexes) against a sample exercising all 5 originally-fixed constructs in one file:
Resulting structural signature counts from the real scan:
high_risk_execution(rm -rf /): 1 ✅events(schedule:): 2 ✅telemetry(::warning::): 1 ✅test_skip(--passWithNoTests): 1 ✅ -- previously blocked by prism.py's _strip_single_line_comments hardcodes '--' as a comment marker for ALL line_exclusive languages, silently truncating real code #697, now fires correctlyreflection_metaprogrammingReDoS bound: unaffected by this fix, already re-verified in Strict tests for yaml, fix 5 real bugs (1 ReDoS) #681's own regression testAll 5 confirmed, including
test_skip, which was the one bug specifically blocked pending #697.golden_crucible, both venvs, against unmodifiedmain:(ran via the new
tests/tools/crucible_check.py-- while dogfooding it here, found and fixedan unrelated pre-existing bug in the script itself, PR #727, confirming both legs are now
genuinely clean rather than accidentally green)
Closing.
fix: crucible_check.py's zero-dep venv incorrectly lacked PyYAML (#727)
Strict tests for yaml, fix 5 real bugs (1 ReDoS) (squid-protocol#681)