Skip to content

fix(v0.44): remediate B1.1 hostile-audit findings F1/F2/F3 (#1270, #1271, #1272) - #1274

Merged
SisyphusZheng merged 3 commits into
devfrom
kimi/v044-b1.1-audit-remediation
Sep 3, 2026
Merged

fix(v0.44): remediate B1.1 hostile-audit findings F1/F2/F3 (#1270, #1271, #1272)#1274
SisyphusZheng merged 3 commits into
devfrom
kimi/v044-b1.1-audit-remediation

Conversation

@SisyphusZheng

Copy link
Copy Markdown
Member

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:

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.md had no row for the route scanner's file-convention grammar/ordering, none for renderer scope matching, and none for text-node escaping.
  • No test imported rendererScopeMatches or evaluated the generated __matchingRenderers; behavioral coverage was asymmetric (codegen side only).
  • escapeText existed as two private copies (internal/compiled/runtime.ts, internal/compiled/server/index.ts); text-node parity was covered only at DOM level.

After

  • Registry gains three rows: route file-convention grammar and declaration ordering (owner: adapter 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).
  • New renderer-scope-parity.test.ts evaluates the generated __matchingRenderers verbatim over an adversarial scope corpus (exact, prefix, nested, non-match, boundary separators, case) and requires observable parity with rendererScopeMatches. RED proven by a deliberate boundary-separator drift of the predicate (both corpus tests fail; drift reverted, not committed).
  • F3 remediation choice: convergence. The two private escapeText copies now import the one shared helper packages/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.ts additionally 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 __matchingRenderers re-expression of rendererScopeMatches — now carries its §4.3 justification in the registry row: canonical owner entry-route-helpers.ts rendererScopeMatches; 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.ts binding corpus (green at this PR's head SHA).

Evidence

All at branch head SHA f5e316e2 (base 94e627bf), macOS arm64, Deno 2.x:

Command Exit
deno test --allow-read --allow-write --allow-env --allow-net --allow-run --allow-ffi --allow-sys packages/element/__tests__/ 0 — 249 passed (11 steps), 0 failed
deno test --allow-read --allow-write --allow-env --allow-net --allow-run --allow-ffi --allow-sys packages/adapter-vite/__tests__/ 0 — 758 passed (94 steps), 0 failed, 1 ignored
deno test … packages/adapter-vite/__tests__/request-time-parity.test.ts (F1 dev-vs-build parity evidence) 0 — 1 passed (23 steps)
deno task fmt:check 0
deno task lint 0
deno task docs:truth (incl. docs:check-version-anchors) 0
deno task docs:check-role-neutral 0
deno task release:evidence:check 0
deno task text-integrity:check 0
deno task package-surface:check 0 — no public export changed
deno task interface:snapshot 0

RED evidence: F3 corpus failed with TS2307 (escape-text.ts not found) before implementation; F2 corpus failed (0 passed, 2 failed) against a deliberately drifted rendererScopeMatches (boundary-separator drift on /docsify), then passed after revert.

Scope

Packet-owned paths only:

  • docs/current/SEMANTIC_OWNERSHIP.md (three registry rows; deno fmt re-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 to packages/adapter-vite/src/internal/ssg/route-scanner.ts, packages/adapter-vite/src/internal/ssg/entry-route-helpers.ts, and packages/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 escapeText is 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.

DevBot 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).
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

APIError: Insufficient Balance

opencode session  |  github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant