fix(v0.44): remediate B1.1 hostile-audit findings F1/F2/F3 (#1270, #1271, #1272) - #1274
Merged
Conversation
added 3 commits
September 3, 2026 11:28
…d helper (#1272) B1.1 hostile-audit finding F3 (#1222): the runtime seed serializer and the server serializer each carried a private byte-identical escapeText with no named owner and no byte-level text parity corpus (constitution §4.3 elements 1 and 3 incomplete). Both now import the one helper at internal/compiled/escape-text.ts, and compiled-escape-parity.test.ts gains a byte-level text corpus (static text nodes and text Parts across both serializers, covering <, >, &, quotes and non-ASCII passthrough).
…es (#1271) B1.1 hostile-audit finding F2 (#1222): the codegen-time renderer scope predicate and its generated runtime re-expression had no parity proof (constitution §4.3 element 3). The new binding corpus evaluates the generated __matchingRenderers verbatim (exact, prefix, nested, non-match, boundary separators, case) and requires observable parity with rendererScopeMatches; a deliberate boundary-separator drift of the predicate fails the corpus.
…d text-escape owner (#1270, #1271, #1272) B1.1 hostile-audit remediation (#1222): the registry of record gains rows for the route file-convention grammar and declaration ordering (owner: route-scanner.ts, constitution §3.3), renderer scope matching (owner: rendererScopeMatches; generated __matchingRenderers recorded as a derived projection with its parity proof), and compiled serializer text-node escaping (owner: internal/compiled/escape-text.ts after convergence).
Contributor
|
APIError: Insufficient Balance |
This was referenced Sep 3, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The B1.1 hostile admission audit (#1222, report
docs/evidence/2026-09-03-v044-hostile-admission-audit.md§4) returned a formal FAIL on three justification/registration findings — explicitly not semantic repairs:parseRouteFilePath) and static-first declaration ordering inroute-scanner.tsare a live semantic surface with no registry row.rendererScopeMatchesmirrors the generated__matchingRendererswith zero binding tests; a predicate drift would be silent.escapeTextin the runtime seed serializer and the server serializer, byte-identical but with no named owner and no byte-level text corpus (the existing escape-parity guard covers attributes only).Part of #1270, #1271, #1272 (B1.1 audit remediation). Umbrella: #1222, stage #1150, #1155.
Owner
Implementer role under dispatch packet B1.1-remediation (constitution §5.1, ADR-0146); thinker owns issue closure — this PR does not close #1270/#1271/#1272 or #1222.
Before
docs/current/SEMANTIC_OWNERSHIP.mdhad no row for the route scanner's file-convention grammar/ordering, none for renderer scope matching, and none for text-node escaping.rendererScopeMatchesor evaluated the generated__matchingRenderers; behavioral coverage was asymmetric (codegen side only).escapeTextexisted as two private copies (internal/compiled/runtime.ts,internal/compiled/server/index.ts); text-node parity was covered only at DOM level.After
route-scanner.ts); renderer scope matching (owner:rendererScopeMatches, generated matcher recorded as a derived projection with its parity proof); compiled serializer text-node escaping (owner:internal/compiled/escape-text.ts).renderer-scope-parity.test.tsevaluates the generated__matchingRenderersverbatim over an adversarial scope corpus (exact, prefix, nested, non-match, boundary separators, case) and requires observable parity withrendererScopeMatches. RED proven by a deliberate boundary-separator drift of the predicate (both corpus tests fail; drift reverted, not committed).escapeTextcopies now import the one shared helperpackages/element/src/internal/compiled/escape-text.ts. Chosen over owner-plus-corpus because it is safe and cheap: the copies were byte-identical, both files already import their attribute-escape contract from a shared module (the [A10] Small correctness sweep for Beta admission #1220 L1 precedent), and convergence removes the §4.3 question permanently instead of maintaining a justification.compiled-escape-parity.test.tsadditionally gains a byte-level text corpus (static text nodes and text Parts across both serializers;<,>,&escaped, quotes and non-ASCII pass through), so any future re-drift is caught. RED proven: the corpus initially failed with TS2307 (module not found) before the helper existed.Why-not-second-owner
This change introduces no new duplicate-looking implementation; it removes one (F3 convergence onto a single shared helper). The one surviving duplicate-looking implementation it retains — the generated
__matchingRenderersre-expression ofrendererScopeMatches— now carries its §4.3 justification in the registry row: canonical ownerentry-route-helpers.tsrendererScopeMatches; reason: generated entries are self-contained and cannot import adapter internals, so the predicate is re-expressed as generated JavaScript (derived projection); parity proof:renderer-scope-parity.test.tsbinding corpus (green at this PR's head SHA).Evidence
All at branch head SHA
f5e316e2(base94e627bf), macOS arm64, Deno 2.x:deno test --allow-read --allow-write --allow-env --allow-net --allow-run --allow-ffi --allow-sys packages/element/__tests__/deno test --allow-read --allow-write --allow-env --allow-net --allow-run --allow-ffi --allow-sys packages/adapter-vite/__tests__/deno test … packages/adapter-vite/__tests__/request-time-parity.test.ts(F1 dev-vs-build parity evidence)deno task fmt:checkdeno task lintdeno task docs:truth(incl.docs:check-version-anchors)deno task docs:check-role-neutraldeno task release:evidence:checkdeno task text-integrity:checkdeno task package-surface:checkdeno task interface:snapshotRED evidence: F3 corpus failed with TS2307 (
escape-text.tsnot found) before implementation; F2 corpus failed (0 passed, 2 failed) against a deliberately driftedrendererScopeMatches(boundary-separator drift on/docsify), then passed after revert.Scope
Packet-owned paths only:
docs/current/SEMANTIC_OWNERSHIP.md(three registry rows;deno fmtre-padded table columns)packages/element/src/internal/compiled/escape-text.ts(new shared helper)packages/element/src/internal/compiled/runtime.ts,packages/element/src/internal/compiled/server/index.ts(private copies removed, import the helper)packages/element/__tests__/compiled-escape-parity.test.ts(text corpus)packages/adapter-vite/__tests__/renderer-scope-parity.test.ts(new binding corpus)Note: the dispatch packet's abbreviated paths (
packages/app/src/route-scanner.ts,packages/adapter-vite/src/entry-route-helpers.ts,packages/element/src/compiled/…) resolve in the real tree topackages/adapter-vite/src/internal/ssg/route-scanner.ts,packages/adapter-vite/src/internal/ssg/entry-route-helpers.ts, andpackages/element/src/internal/compiled/…. No ADR-0122 frozen path was touched, so no ADR-0151 commit-message citation is required. Nothing outside the packet was edited; no issue is closed by this PR.Risk
None material. The converged
escapeTextis byte-identical to both prior private copies, so serializer output bytes are unchanged (proven by the corpus and the full element suite). Deferred per packet: the thinker closes #1270/#1271/#1272 and #1222; audit observations O1–O3 (stale comment, legacy markers, re-baseline) are out of this packet's scope.