Skip to content

Fix frontmatter scalar validation and reject hidden policy whitespace - #3067

Closed
Chris0Jeky wants to merge 138 commits into
mainfrom
codex/3006-frontmatter-scalars-20260912
Closed

Chris0Jeky wants to merge 138 commits into
mainfrom
codex/3006-frontmatter-scalars-20260912

Conversation

@Chris0Jeky

@Chris0Jeky Chris0Jeky commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #3006.

Repair the dependency-free control-path mirror validator without editing CI policy, workflows or the agent rule itself. Plain scalars retain internal apostrophes/brackets; leading quoted scalars are parsed completely; malformed/unsupported mappings, list indentation, tags/aliases, trailing quoted garbage and policy whitespace fail closed. Quoted alias-like globs and supported string escapes are handled explicitly. Duplicate-key wording no longer makes an incorrect claim about loader behavior.

This deliberately accepts a documented subset of YAML rather than approximating arbitrary YAML. Issue #3005 still owns wiring the regression suites into the hosted docs job.

Review follow-up

Head dda9caa4105c26a533d08194111ae501fb9b0793 addresses the first automated review's quoted-empty metadata-list finding (discussion_r3997359370). Empty quoted metadata strings now work in scalar/list form; empty paths and missing/unquoted list values remain rejected. Six added cases reproduced two failures before the correction and pass afterward. Exact-head review of this follow-up remains required.

Validation

Linux / Node v22.16.0, uploaded snapshot in an isolated linked worktree. The original two changed scripts matched live main 54e4c0a86fb77eabba73b5d21557d6f8720571bd byte-for-byte; remote history starts on that real main commit, not reconstructed snapshot history.

  • 45 new regressions + 26 existing cases = 71 passed / 0 failed on the final local version.
  • Initial red/green: 32 pass / 33 fail, then 65 pass. Review follow-up red/green: 69 pass / 2 fail, then 71 pass.
  • Broader node --test scripts/check-*.test.mjs: 183 passed / 2 failed. Both also reproduce on unchanged source (138 passed / 2 failed): wrong-case-vs-missing link diagnostic on the case-sensitive filesystem, and an indirectly imported staging fixture requiring absent Docker. No broad-green claim; the link-test portability finding is also documented on [CI][Docs governance] Run check-docs-governance.test.mjs and check-doc-links.test.mjs in the docs-governance job (control-plane follow-up to PR #3002) #3005.
  • Docs governance, GitHub-operations governance, doc-link check (700 Markdown files, 0 broken relative links) and git diff --check pass.
  • No full frontend/backend/browser run or complete required-CI verdict is claimed. Hosted results from the earlier head do not qualify the follow-up head.

Integration and scope

Three files only: validator, its regression suite and a dedicated analysis/evidence note. No overlap with inspected #3066 feature paths or archive-editor/estimate changes. No canonical STATUS/MASTERPLAN churn, human-checkbox edits, project-wide priority sync, required-context changes, merge or deployment. Existing device/screen-reader, release/hosting and CI-control-plane decisions remain unchanged. Run the focused suite explicitly while #3005 remains open.

@Chris0Jeky Chris0Jeky left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh-context review of the follow-up head: no merge-blocking parser or fail-closedness finding.

The implementation now describes and enforces one explicit YAML subset instead of partially emulating arbitrary YAML. Quoted scalars are consumed completely; doubled single quotes and JSON-compatible double-quote escapes are handled; plain scalars retain internal quotes/brackets; leading structural indicators, flow collections, nested mappings, block scalars, tags/aliases, tabs and inconsistent list indentation fail closed. Path entries additionally reject empty, trimmed-different and control-character values, while quoted empty metadata values remain valid.

The full-frontmatter walk is important: malformed material after paths cannot be ignored while certifying the rule. Duplicate keys also fail without making a claim about which value an external loader would choose.

Exact-head Required CI 34715606746 and Smart CI 34715606620 are successful. CI Extended's only failure is the repository's unrelated Load and Concurrency Harness; workflow lint, PostgreSQL Testcontainers, backend solution regression, E2E and the other reported jobs passed. Issue #3005 still owns wiring these focused parser regressions into the hosted docs-governance lane. Within that stated boundary, this PR is ready for maintainer review.

@Chris0Jeky Chris0Jeky left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PARKED at the review/fix ceiling on exact base ce97301bd7436008941950c010c2ade48dea2c41 and head 9fea3430bf6a1e2ae74186bcb31fcf63c659946b.

The Unicode-edge/NUL repair passes 83 focused tests, governance, syntax, doc links, and diff check. The bounded verification pass nevertheless confirmed two remaining HIGH fail-open cases:

  1. decoded internal controls (\n, \r, \t, C1 controls) can remain inside a mirrored path; the checker returns green while the resulting glob does not match the intended control file;
  2. unquoted YAML implicit types such as null, true, and 123 are accepted as string paths even though a core-schema YAML loader resolves them as non-strings.

Both can certify an ineffective/non-string control-path mirror. This is the verification pass after the permitted fix round and neither finding is a newly introduced CRITICAL, so repository policy parks the PR instead of reopening another parser cycle. Hosted exact-head CI is not treated as merge evidence for this parked head.

Copy link
Copy Markdown
Owner Author

@codex address that feedback

Please fix and regression-test the two confirmed HIGH fail-open cases on the current branch, limited to the intended validator/test/evidence files:

  1. Reject every decoded internal control character in mirrored paths, including \n, \r, \t, C0, DEL, and C1 controls. This must apply after quoted-scalar escape decoding as well as to plain/policy JSON strings. Preserve ordinary visible Unicode.
  2. Reject unquoted YAML implicit non-string scalars for path entries, including null forms, booleans, integer/float/scientific forms, infinities/NaN, dates/timestamps, and equivalent case variants where the YAML core schema resolves a non-string. Quoted forms must remain strings and may be accepted subject to the path rules.

Add focused red/green tests and keep all existing supported scalar behavior. Do not touch unrelated files despite the contaminated PR history. I will recover the resulting three intended files onto a clean current-main branch after verification.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • node --test scripts/check-docs-governance.test.mjs — 115 passed, 0 failed.
  • node --check scripts/check-docs-governance.mjs
  • node scripts/check-docs-governance.mjs
  • node scripts/check-doc-links.mjs — 706 Markdown files checked, 0 broken relative links.
  • node scripts/check-github-ops-governance.mjs
  • git diff --check
  • ⚠️ node --test scripts/check-*.test.mjs — 226 passed and 2 unrelated known failures: the case-sensitive link diagnostic returns missing instead of wrong case, and the Compose fixture cannot run because Docker is unavailable (spawn docker ENOENT). These limitations are recorded in the evidence note. docs/analysis/2026-09-12-frontmatter-scalar-validation.mdL61-L70
  • ⚠️ powershell -File scripts/check-git-env.ps1 — PowerShell is not installed in this Linux environment; repository status was checked directly with Git instead.

View task →

Copy link
Copy Markdown
Owner Author

@codex please publish the completed three-file validator fix. GitHub cannot resolve local commit 224ac8300cca6bc3999dd700f380260f7aa66475, and the PR branch has not moved. Push the exact tested validator, regression, and evidence blobs to codex/3006-frontmatter-scalars-20260912; do not touch the other contaminated-history files or create a duplicate PR. I will then extract only those three blobs onto a clean current-main branch.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • node --test scripts/check-docs-governance.test.mjs — 115 passed, 0 failed.
  • node --check scripts/check-docs-governance.mjs
  • node scripts/check-docs-governance.mjs
  • node scripts/check-doc-links.mjs — 706 Markdown files checked, 0 broken relative links.
  • node scripts/check-github-ops-governance.mjs
  • git diff --check
  • ⚠️ node --test scripts/check-*.test.mjs — 227 passed, 2 pre-existing environment/baseline failures: the case-sensitive link diagnostic reports missing rather than wrong case, and the staging fixture requires unavailable Docker. These limitations are documented in the evidence note. docs/analysis/2026-09-12-frontmatter-scalar-validation.mdL59-L69
  • git push origin HEAD:refs/heads/codex/3006-frontmatter-scalars-20260912 — publication failed because Git could not obtain GitHub credentials from this non-interactive runner.

View task →

Copy link
Copy Markdown
Owner Author

Clean replacement opened as #3134 from current main. It contains exactly the repaired validator, focused regression suite, and evidence note from head 9fea3430bf6a1e2ae74186bcb31fcf63c659946b, with no contaminated-history files. I am leaving this PR open until #3134 completes exact-head CI and review, then this branch can be closed as superseded.

@Chris0Jeky

Copy link
Copy Markdown
Owner Author

Superseded by merged PR #3134, which carries the repaired frontmatter governance implementation and its final terminal-surrogate fix. Closing this contaminated-history predecessor; the review and evidence remain available here for provenance.

@Chris0Jeky Chris0Jeky closed this Sep 17, 2026
@github-project-automation github-project-automation Bot moved this from Pending to Done in Taskdeck Execution Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority IV Later maturity/deepening; revisited at horizon planning. tech-debt Debt cleanup or deferred engineering quality work with limited product-surface change. testing Test coverage, harnesses, regression prevention, and verification pipeline work.

Projects

Status: Done

1 participant