@xenosystem/agent-sdk 0.9.10 → 0.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/LICENSE +15 -15
  2. package/README.md +511 -511
  3. package/dist/agents/index.cjs +9 -9
  4. package/dist/agents/index.d.cts +12 -2
  5. package/dist/agents/index.d.ts +12 -2
  6. package/dist/agents/index.js +9 -9
  7. package/dist/agents/metafile-cjs.json +1 -1
  8. package/dist/agents/metafile-esm.json +1 -1
  9. package/dist/artifacts/browser.cjs +1 -1
  10. package/dist/artifacts/browser.d.cts +2 -2
  11. package/dist/artifacts/browser.d.ts +2 -2
  12. package/dist/artifacts/browser.js +1 -1
  13. package/dist/artifacts/{diff-artifact-C2tQZWcs.d.cts → diff-artifact-CmhmeSu5.d.cts} +87 -7
  14. package/dist/artifacts/{diff-artifact-C2tQZWcs.d.ts → diff-artifact-CmhmeSu5.d.ts} +87 -7
  15. package/dist/artifacts/index.cjs +8 -8
  16. package/dist/artifacts/index.d.cts +22 -5
  17. package/dist/artifacts/index.d.ts +22 -5
  18. package/dist/artifacts/index.js +8 -8
  19. package/dist/artifacts/metafile-cjs.json +1 -1
  20. package/dist/artifacts/metafile-esm.json +1 -1
  21. package/dist/automation/index.cjs +2 -2
  22. package/dist/automation/index.d.cts +98 -7
  23. package/dist/automation/index.d.ts +98 -7
  24. package/dist/automation/index.js +2 -2
  25. package/dist/automation/metafile-cjs.json +1 -1
  26. package/dist/automation/metafile-esm.json +1 -1
  27. package/dist/control-plane/index.cjs +7 -7
  28. package/dist/control-plane/index.d.cts +19 -2
  29. package/dist/control-plane/index.d.ts +19 -2
  30. package/dist/control-plane/index.js +7 -7
  31. package/dist/control-plane/metafile-cjs.json +1 -1
  32. package/dist/control-plane/metafile-esm.json +1 -1
  33. package/dist/control-room/metafile-cjs.json +1 -1
  34. package/dist/control-room/metafile-esm.json +1 -1
  35. package/dist/electron/index.cjs +143 -143
  36. package/dist/electron/index.d.cts +25 -4
  37. package/dist/electron/index.d.ts +25 -4
  38. package/dist/electron/index.js +141 -141
  39. package/dist/electron/metafile-cjs.json +1 -1
  40. package/dist/electron/metafile-esm.json +1 -1
  41. package/dist/governance/index.cjs +18 -18
  42. package/dist/governance/index.d.cts +1 -0
  43. package/dist/governance/index.d.ts +1 -0
  44. package/dist/governance/index.js +18 -18
  45. package/dist/governance/metafile-cjs.json +1 -1
  46. package/dist/governance/metafile-esm.json +1 -1
  47. package/dist/hooks/index.d.cts +10 -1
  48. package/dist/hooks/index.d.ts +10 -1
  49. package/dist/hooks/metafile-cjs.json +1 -1
  50. package/dist/hooks/metafile-esm.json +1 -1
  51. package/dist/hosted/index.cjs +1 -1
  52. package/dist/hosted/index.js +1 -1
  53. package/dist/hosted/metafile-cjs.json +1 -1
  54. package/dist/hosted/metafile-esm.json +1 -1
  55. package/dist/index.cjs +332 -332
  56. package/dist/index.d.cts +200 -25
  57. package/dist/index.d.ts +200 -25
  58. package/dist/index.js +333 -333
  59. package/dist/intelligence/metafile-cjs.json +1 -1
  60. package/dist/intelligence/metafile-esm.json +1 -1
  61. package/dist/mcp/index.cjs +17 -17
  62. package/dist/mcp/index.d.cts +1 -0
  63. package/dist/mcp/index.d.ts +1 -0
  64. package/dist/mcp/index.js +17 -17
  65. package/dist/mcp/metafile-cjs.json +1 -1
  66. package/dist/mcp/metafile-esm.json +1 -1
  67. package/dist/metafile-cjs.json +1 -1
  68. package/dist/metafile-esm.json +1 -1
  69. package/dist/oracle/index.cjs +1 -1
  70. package/dist/oracle/index.d.cts +86 -6
  71. package/dist/oracle/index.d.ts +86 -6
  72. package/dist/oracle/index.js +1 -1
  73. package/dist/oracle/metafile-cjs.json +1 -1
  74. package/dist/oracle/metafile-esm.json +1 -1
  75. package/dist/providers/index.cjs +10 -10
  76. package/dist/providers/index.d.cts +1 -0
  77. package/dist/providers/index.d.ts +1 -0
  78. package/dist/providers/index.js +10 -10
  79. package/dist/providers/metafile-cjs.json +1 -1
  80. package/dist/providers/metafile-esm.json +1 -1
  81. package/dist/recipes/index.cjs +2 -2
  82. package/dist/recipes/index.d.cts +10 -1
  83. package/dist/recipes/index.d.ts +10 -1
  84. package/dist/recipes/index.js +2 -2
  85. package/dist/recipes/metafile-cjs.json +1 -1
  86. package/dist/recipes/metafile-esm.json +1 -1
  87. package/dist/research/index.cjs +3 -3
  88. package/dist/research/index.d.cts +86 -6
  89. package/dist/research/index.d.ts +86 -6
  90. package/dist/research/index.js +3 -3
  91. package/dist/research/metafile-cjs.json +1 -1
  92. package/dist/research/metafile-esm.json +1 -1
  93. package/dist/session/index.cjs +20 -20
  94. package/dist/session/index.d.cts +1 -0
  95. package/dist/session/index.d.ts +1 -0
  96. package/dist/session/index.js +21 -21
  97. package/dist/session/metafile-cjs.json +1 -1
  98. package/dist/session/metafile-esm.json +1 -1
  99. package/dist/sharing/metafile-cjs.json +1 -1
  100. package/dist/sharing/metafile-esm.json +1 -1
  101. package/dist/skills/index.d.cts +1 -0
  102. package/dist/skills/index.d.ts +1 -0
  103. package/dist/skills/metafile-cjs.json +1 -1
  104. package/dist/skills/metafile-esm.json +1 -1
  105. package/dist/soul/metafile-cjs.json +1 -1
  106. package/dist/soul/metafile-esm.json +1 -1
  107. package/dist/terminal/metafile-cjs.json +1 -1
  108. package/dist/terminal/metafile-esm.json +1 -1
  109. package/dist/ui/index.d.cts +1 -0
  110. package/dist/ui/index.d.ts +1 -0
  111. package/dist/ui/metafile-cjs.json +1 -1
  112. package/dist/ui/metafile-esm.json +1 -1
  113. package/dist/utils/index.cjs +20 -20
  114. package/dist/utils/index.d.cts +4 -1
  115. package/dist/utils/index.d.ts +4 -1
  116. package/dist/utils/index.js +17 -17
  117. package/dist/utils/metafile-cjs.json +1 -1
  118. package/dist/utils/metafile-esm.json +1 -1
  119. package/native/mxc/LICENSE.microsoft-mxc-sdk.md +20 -20
  120. package/native/mxc/README.md +25 -25
  121. package/native/mxc/package.json +58 -58
  122. package/ownership/CLEAN_ROOM_CONTRIBUTOR_GUIDE.md +63 -63
  123. package/ownership/evidence/PROPRIETARY-COMMAND-1/implementation-record.md +77 -77
  124. package/ownership/evidence/PROPRIETARY-COMMAND-1/provenance-review.md +51 -51
  125. package/ownership/evidence/PROPRIETARY-MEDIA-1/implementation-record.md +131 -131
  126. package/ownership/evidence/PROPRIETARY-MEDIA-1/provenance-review.md +50 -50
  127. package/ownership/evidence/PROPRIETARY-PTY-1/implementation-record.md +86 -86
  128. package/ownership/evidence/PROPRIETARY-PTY-1/provenance-review.md +52 -52
  129. package/ownership/evidence/PROPRIETARY-RUNTIME-1/implementation-record.md +68 -68
  130. package/ownership/evidence/PROPRIETARY-RUNTIME-1/provenance-review.md +32 -32
  131. package/ownership/evidence/PROPRIETARY-TOOLCHAIN-1/implementation-record.md +53 -53
  132. package/ownership/evidence/PROPRIETARY-TOOLCHAIN-1/provenance-review.md +32 -32
  133. package/ownership/evidence/PROPRIETARY-UI-1/implementation-record.md +96 -96
  134. package/ownership/evidence/PROPRIETARY-UI-1/provenance-review.md +46 -46
  135. package/ownership/ownership-policy.schema.json +192 -192
  136. package/ownership/templates/clean-room-implementation-record.md +70 -70
  137. package/ownership/templates/provenance-review.md +51 -51
  138. package/package.json +23 -22
@@ -1,131 +1,131 @@
1
- # Clean-Room Implementation Record: Xeno-Owned Media Stack
2
-
3
- ## Identity
4
-
5
- - Component: Xeno-owned zlib/DEFLATE, PNG, JPEG, GIF, VP8/VP8L WebP, image metadata/color, and secure SVG preview stack
6
- - Replacement milestone: PROPRIETARY-MEDIA-1
7
- - Repository and paths: `xeno-agent-sdk/src/media/`, `src/tools/read-image.ts`, `scripts/generate-vp8-tables.mjs`
8
- - Record owner: Xeno engineering, final owner assignment pending
9
- - Implementer(s): Codex implementation assistant; human codec/security review pending
10
- - Contract author(s): Xeno engineering requirements in `switch-to-proprietary.md`
11
- - Started at (UTC): 2026-07-12
12
- - Candidate revision: `a59066e477c904e077b1aceed8a65fa9c2767535` plus recorded working-tree changes
13
- - Status: engineering candidate complete for the documented SDK matrix; independent provenance, corpus/fuzz, counsel, and release gates pending
14
-
15
- ## Frozen behavioral contract
16
-
17
- - Capability matrix: `docs/owned-media-matrix.md` is the authoritative list of accepted profiles, deterministic policies, limits, and explicit rejections.
18
- - Compression: owned zlib/DEFLATE decode validates framing, final-block consumption, output limit, and Adler-32; deterministic zlib/gzip encode is owned.
19
- - PNG: every legal color-type/bit-depth family, all filters, Adam7, palette/transparency, bounded color metadata, Exif orientation, and deterministic RGB8 encode.
20
- - JPEG: Huffman baseline/progressive DCT, sampling, restart intervals, grayscale/RGB/YCbCr/CMYK/YCCK, and Exif orientation; unsupported coding modes reject.
21
- - GIF: GIF87a/GIF89a palettes, LZW, interlace, transparency, logical-canvas composition, delay, disposal, and loop metadata; preview policy is first rendered frame.
22
- - WebP: strict RIFF/VP8X, owned VP8 key-frame decode, VP8L, ALPH, bounded RGB matrix/TRC ICC, Exif, and validated first-frame animation composition.
23
- - SVG: bounded UTF-8 XML, paths/curves/arcs, transforms, simple CSS, gradients, clipping, masks, bounded local references, owned bitmap text, and supersampling.
24
- - Security: no external URL/entity/script/image/document load; byte, pixel, frame, recursion, path, node, sample, operation, and output limits.
25
- - Integration: ReadImage uses only owned media paths for supported bounded previews; no direct-compressed escape hatch is used when an owned decoder exists.
26
- - Intentional incompatibilities: unsupported profiles fail explicitly or follow the documented still/first-frame policy. The stack does not claim every JPEG/WebP/SVG extension.
27
-
28
- ## Normative and permitted inputs
29
-
30
- | Source | Revision/date | Purpose | Terms reviewed by | Evidence path |
31
- | --- | --- | --- | --- | --- |
32
- | Xeno proprietary migration specification | 2026-07-12 | Media ownership, compatibility, security, and release gates | Engineering; counsel pending | `switch-to-proprietary.md` |
33
- | RFC 1950, RFC 1951, RFC 1952 | published RFC revisions | zlib, DEFLATE, and gzip framing/bitstream behavior | Engineering; counsel pending | public RFC text |
34
- | W3C PNG Third Edition | accessed 2026-07-12 | PNG chunk, color, filtering, interlace, and error behavior | Engineering; counsel pending | `https://www.w3.org/TR/png-3/` |
35
- | ITU-T T.81 and T.871 | public recommendations | JPEG DCT/Huffman and JFIF behavior | Engineering; counsel pending | ITU public recommendations |
36
- | GIF89a specification | public specification | GIF blocks, LZW, interlace, control extensions, and animation | Engineering; counsel pending | public GIF89a text |
37
- | RFC 6386 | source SHA-256 `e89d0369d8e8c2ab0b080ef142bd27bebb2f228285ea34bd35d55b8e623d3259` | VP8 syntax, probabilities, prediction, transforms, and filtering | Engineering; counsel pending | generated-table source metadata |
38
- | Google WebP RIFF and lossless specifications | accessed 2026-07-12 | WebP container, VP8L, ALPH, metadata, and animation | Engineering; counsel pending | public Google specifications |
39
- | W3C SVG 2 and SVG Paths | accessed 2026-07-12 | vector geometry, transforms, rendering, gradients, clipping, masks, and text contract | Engineering; counsel pending | public W3C specifications |
40
- | Existing Xeno ReadImage contracts | candidate working tree | preview lifecycle, transport limits, private artifacts, and source immutability | Engineering | `src/tools/read-image.ts`, focused tests |
41
-
42
- ## Contributor source-exposure disclosure
43
-
44
- | Contributor | Inspected replaced source? | Date/range | Separation or review decision | Counsel reference |
45
- | --- | --- | --- | --- | --- |
46
- | Codex implementation assistant | No third-party codec implementation source was inspected. Public specifications and black-box oracle outputs were used. | 2026-07-12 | Independent source/provenance review required | Pending |
47
- | Codex implementation assistant | Xeno-owned sibling SVG files were inspected only to determine that they depended on browser DOM/canvas or were stubs; no source was copied into this implementation. | 2026-07-12 | Cross-repository Xeno ownership must be independently confirmed | Pending |
48
- | Human contributors | Disclosure not yet collected | Pending | Must be completed before capability approval | Pending |
49
-
50
- ## Implementation log
51
-
52
- | Date (UTC) | Decision | Contract/source basis | Author | Evidence path |
53
- | --- | --- | --- | --- | --- |
54
- | 2026-07-12 | Replace Node zlib with owned bounded DEFLATE/zlib/gzip logic | FR-052 | Codex implementation assistant | `src/media/xeno-deflate.ts` |
55
- | 2026-07-12 | Complete PNG profile and deterministic encode | FR-051 | Codex implementation assistant | `src/media/xeno-raster.ts`, `tests/xeno-png.test.mjs` |
56
- | 2026-07-12 | Implement baseline/progressive JPEG, Exif, CMYK, and YCCK | FR-053 | Codex implementation assistant | `src/media/xeno-jpeg.ts` |
57
- | 2026-07-12 | Implement full bounded GIF frame composition and first-frame policy | FR-054 | Codex implementation assistant | `src/media/xeno-gif.ts` |
58
- | 2026-07-12 | Generate normative VP8 tables from a pinned RFC hash and implement VP8 key-frame decode | FR-055 | Codex implementation assistant | `scripts/generate-vp8-tables.mjs`, `src/media/xeno-vp8*.ts` |
59
- | 2026-07-12 | Implement VP8L, ALPH, metadata, container validation, and first-frame animation | FR-055 | Codex implementation assistant | `src/media/xeno-webp.ts` |
60
- | 2026-07-12 | Add bounded RGB matrix/TRC ICC and shared Exif orientation | media color/metadata contract | Codex implementation assistant | `src/media/xeno-image-metadata.ts` |
61
- | 2026-07-12 | Replace the line-only SVG subset with the approved secure owned renderer | FR-056 through FR-058 | Codex implementation assistant | `src/media/xeno-svg.ts`, `src/media/xeno-svg-geometry.ts` |
62
- | 2026-07-12 | Remove stale direct-compressed claims and document exact profiles | FR-050 | Codex implementation assistant | `docs/owned-media-matrix.md`, README, tool description |
63
- | 2026-07-12 | Classify black-box oracle tools and external corpora while preserving production exclusion | ownership policy | Codex implementation assistant | ownership policy revision 10 |
64
- | 2026-07-12 | Audit and reject current `xeno-lib` media integration because its still-image/vector graph remains external-backed | cross-repository ownership gate | Codex implementation assistant | `docs/xeno-lib-media-boundary.md` |
65
- | 2026-07-12 | Run pinned external PNG/JPEG/WebP/SVG corpora and fix WebP unknown-chunk interoperability | media conformance and WebP RIFF specification | Codex implementation assistant | `docs/external-media-corpora.md`, `docs/compliance/external-media-corpora.json` |
66
- | 2026-07-12 | Run a deterministic 60-second external-corpus mutation campaign | media fuzz engineering gate | Codex implementation assistant | `scripts/fuzz-external-media.mjs`, `docs/compliance/external-media-fuzz.json` |
67
- | 2026-07-12 | Reacquire every pinned corpus, reproduce all digests/outcomes, and run a separate five-minute deterministic mutation campaign | sustained local media engineering evidence | Codex implementation assistant | `docs/compliance/external-media-fuzz-sustained.json` |
68
- | 2026-07-12 | Add a supervised V8 precise-coverage feedback loop with deterministic mutation, per-codec gates, current-case persistence, and tested idle/hard watchdogs across all nine claimed decoder paths | feedback-guided fuzz engineering gate | Codex implementation assistant | `scripts/fuzz-external-media-coverage*.mjs`, `tests/external-media-coverage-fuzz.test.mjs`, `docs/compliance/external-media-fuzz-coverage-sustained.json` |
69
-
70
- ## AI assistance and test-oracle use
71
-
72
- - Models/tools used: OpenAI Codex coding agent, local PowerShell, TypeScript, tsup, and Node test runner.
73
- - Prompt or retained prompt-summary path: active Xeno proprietary migration goal and `switch-to-proprietary.md`.
74
- - Black-box oracles: Node zlib, Pillow, ImageMagick, libwebp, and libvpx were used only to generate or compare isolated fixture outputs. Their implementations are not imported, linked, bundled, dynamically discovered, or invoked by production code.
75
- - Normative generation: RFC 6386 numeric tables are generated from a caller-supplied source with an exact pinned SHA-256. Reproduction on 2026-07-12 produced checked-in SHA-256 `89f8368f813f8c07cfb070c0c070d8ca1179d4051ca248e97de71125c2ca5d9e` byte-for-byte.
76
- - Confirmation that no third-party implementation entered the prompt: no codec source was supplied or inspected; oracle pixels/containers and public specification text were used.
77
- - Human review performed: pending.
78
-
79
- ## Verification evidence
80
-
81
- - Focused media/read-image/fuzz-supervisor gate: 69 passed, 0 failed after adding feedback-guided coverage and watchdog regressions.
82
- - External corpus engineering run: PNGSuite 60/60 accepted; libjpeg-turbo 2 supported images accepted and 2 documented unsupported profiles rejected; WebM Project WebP 130/131 accepted with the intentionally truncated vector rejected; all 525 unmodified W3C SVG files rejected at the secure-subset boundary. Exact per-file hashes and outcomes are recorded in `docs/compliance/external-media-corpora.json`.
83
- - External mutation engineering run: 48,334 iterations in 60 seconds across PNG/JPEG/WebP/SVG, zero output invariant failures, and peak RSS 302,944,256 bytes. This does not replace the independently approved sustained fuzz gate.
84
- - Independent corpus reacquisition rerun: exact upstream revisions plus W3C archive SHA reproduce all four recorded corpus digests and all 720 accepted/rejected outcomes with zero expectation failures.
85
- - Five-minute mutation engineering run: 279,559 iterations across PNG/JPEG/WebP/SVG, zero output invariant failures, and peak RSS 321,949,696 bytes. Report SHA-256 is `5d22c7acc275d6e43ec83feebc61e8576e048ee930eae735b7164565c456c604`. This remains deterministic engineering evidence, not independently approved coverage-guided fuzzing.
86
- - Five-minute feedback-guided engineering run: 78,978 mutations across PNG/JPEG/WebP/SVG/GIF/BMP/PBM/PGM/PPM, 1,415 unique executed owned-bundle ranges, 232 retained coverage-increasing inputs, zero output invariant failures, zero slow inputs, zero watchdog terminations, and 459,878,400-byte peak RSS. Report SHA-256 is `4fae930893f14e7170da85e9bc2e621f340cbc327f5c863fac3139b91113b018`; formal approval remains false pending independent threshold, sanitizer, corpus, and triage review.
87
- - Paired local SDK/CLI candidate tarballs passed clean installation, ownership parity, canvas exclusion, residue scan, packaged command/benchmark checks, and the owned preview doctor check before the strict verifier stopped on the unsigned PTY release gate. Candidate hashes and scope are in the CLI `docs/compliance/paired-package-candidate.md` record.
88
- - Full SDK regression: 501 passed, 2 platform-dependent skips, 0 failures.
89
- - Linked CLI integration: source and CLI typechecks pass, the CLI bundle builds, and Vitest reports 163 files with 1,490 passed, 1 skipped, and 0 failures.
90
- - Type verification: `npm run typecheck` and `npm run typecheck:tests` pass.
91
- - Ownership proof: artifact-inclusive SDK audit reports pre-P1, target P2, 823 component records, and 0 violations. Capability remains pre-P1 because P1 evidence gates are intentionally not approved.
92
- - Runtime exclusion scan: no `node:zlib`, canvas package, resvg, sharp, Jimp, React DOM, or equivalent media fallback in the scanned SDK production source/manifest/lock graph.
93
- - Source hashes:
94
- - `xeno-deflate.ts`: `61badde76048cba77a432a9a1e737de4fe49ffd6b877833b76062133851b0ae3`
95
- - `xeno-raster.ts`: `6a7069fdd3dc6c4045feff36731fdf942fdaba71876b95b19cc8b2db49fc3ec6`
96
- - `xeno-image-metadata.ts`: `544e1b8e14b30c1948a79887495077727fea62cbcea118edf3a108ebf8cf7973`
97
- - `xeno-jpeg.ts`: `ad57118e4d35c29d8c5bb69f98b0be0f2442f500dc78cdf14f1f5e9330001280`
98
- - `xeno-gif.ts`: `bda46489a77176b7ef910ab980b19468ea21a581db44333e71899495120998be`
99
- - `xeno-vp8.ts`: `e0808f97bc9c2c727fc22e91fc0c7660b0b2ebd597bb44593a7afd43975fca07`
100
- - `xeno-vp8-tables.ts`: `89f8368f813f8c07cfb070c0c070d8ca1179d4051ca248e97de71125c2ca5d9e`
101
- - `xeno-webp.ts`: `54f65311182391c67759361b49a7ab2b8cd744ce9034bdc1ee6b88b33b0faee3`
102
- - `xeno-svg-geometry.ts`: `89fcbc0ddf7ae852cfa9f7c0323ff3da7e510a4581288c76c40060ae80abbcb0`
103
- - `xeno-svg.ts`: `edc1f03f20208efd26fa3a40afff039fccfe87936d1b5a60fb8b5a9c60eab638`
104
- - `generate-vp8-tables.mjs`: `00ce9cac50fcf6e12a059da6a0744cb807e9dbda0c4e3d2df93ca9b634d1f9e4`
105
- - `run-external-media-corpora.mjs`: `5e4c9910cd5fc403d331b5ca382b100cb367f0008c8f5275106e73301541232c`
106
- - `external-media-corpora.json`: `a98533c06ff3929cc7b4d961739536f7f7532ad6583429f948c9f5e0c2477084`
107
- - `fuzz-external-media.mjs`: `0c3dc2c1baf15b8325fc7b9692485947e28521269c4304289883c1b025584072`
108
- - `external-media-fuzz.json`: `a2c4e32e9ebc914595d300636538d5f6a36f786b10b8cbff1374c71f444510cd`
109
- - `external-media-fuzz-sustained.json`: `5d22c7acc275d6e43ec83feebc61e8576e048ee930eae735b7164565c456c604`
110
- - `read-image.ts`: `151f009e882bd561345d380df204e8b8add56db081e89ee09d1b234f649e28e2`
111
- - `fuzz-external-media-coverage.mjs`: `14e383b65995ab3f942c0411e070843cd18c16999373c9943bff1141c76d0fcd`
112
- - `fuzz-external-media-coverage-worker.mjs`: `fd557232dc38ea6b2ce6b95f79cde983f417d35bb49ecf39383f9b1f1d3f6636`
113
- - `external-media-fuzz-coverage-sustained.json`: `4fae930893f14e7170da85e9bc2e621f340cbc327f5c863fac3139b91113b018`
114
-
115
- ## Open legal, provenance, and engineering questions
116
-
117
- - Independent clean-room/source-structure review is pending.
118
- - Contributor source-exposure disclosures and counsel disposition are pending.
119
- - JPEG, GIF history, VP8/WebP, ICC, DEFLATE, SVG/font rendering, and specification-table rights require counsel review before public claims.
120
- - The committed tests plus deterministic and feedback-guided five-minute campaigns are not self-approving evidence; independent reviewers must approve coverage/duration thresholds, native sanitizer and release-architecture scope, corpus terms, and triage policy.
121
- - Pinned external corpora are selected, classified, hashed, and run for engineering evidence, but their terms/counsel disposition, independent rerun, pixel-oracle comparisons, and an approved secure-SVG subset corpus remain pending.
122
- - ARM, macOS, signed release, and self-contained-product artifact coverage remain outside this engineering record. A local paired npm clean-install audit reached only the expected unsigned-PTY blocker and is not a completed release gate.
123
- - `xeno-lib` reconciliation is decided and documented in `docs/xeno-lib-media-boundary.md`: its current `image` and `vtracer` bootstrap-engine graph is not accepted as a production owner. Future integration remains gated on a separately proprietary graph and full cross-repository evidence.
124
-
125
- ## Handoff
126
-
127
- - Engineering implementation complete for documented SDK matrix: yes
128
- - Evidence complete: no
129
- - Capability gate may be marked achieved: no
130
- - Ready for independent provenance review: yes, after corpus licensing/classification and contributor disclosure collection
131
- - Author/date: Codex implementation assistant, 2026-07-12
1
+ # Clean-Room Implementation Record: Xeno-Owned Media Stack
2
+
3
+ ## Identity
4
+
5
+ - Component: Xeno-owned zlib/DEFLATE, PNG, JPEG, GIF, VP8/VP8L WebP, image metadata/color, and secure SVG preview stack
6
+ - Replacement milestone: PROPRIETARY-MEDIA-1
7
+ - Repository and paths: `xeno-agent-sdk/src/media/`, `src/tools/read-image.ts`, `scripts/generate-vp8-tables.mjs`
8
+ - Record owner: Xeno engineering, final owner assignment pending
9
+ - Implementer(s): Codex implementation assistant; human codec/security review pending
10
+ - Contract author(s): Xeno engineering requirements in `switch-to-proprietary.md`
11
+ - Started at (UTC): 2026-07-12
12
+ - Candidate revision: `a59066e477c904e077b1aceed8a65fa9c2767535` plus recorded working-tree changes
13
+ - Status: engineering candidate complete for the documented SDK matrix; independent provenance, corpus/fuzz, counsel, and release gates pending
14
+
15
+ ## Frozen behavioral contract
16
+
17
+ - Capability matrix: `docs/owned-media-matrix.md` is the authoritative list of accepted profiles, deterministic policies, limits, and explicit rejections.
18
+ - Compression: owned zlib/DEFLATE decode validates framing, final-block consumption, output limit, and Adler-32; deterministic zlib/gzip encode is owned.
19
+ - PNG: every legal color-type/bit-depth family, all filters, Adam7, palette/transparency, bounded color metadata, Exif orientation, and deterministic RGB8 encode.
20
+ - JPEG: Huffman baseline/progressive DCT, sampling, restart intervals, grayscale/RGB/YCbCr/CMYK/YCCK, and Exif orientation; unsupported coding modes reject.
21
+ - GIF: GIF87a/GIF89a palettes, LZW, interlace, transparency, logical-canvas composition, delay, disposal, and loop metadata; preview policy is first rendered frame.
22
+ - WebP: strict RIFF/VP8X, owned VP8 key-frame decode, VP8L, ALPH, bounded RGB matrix/TRC ICC, Exif, and validated first-frame animation composition.
23
+ - SVG: bounded UTF-8 XML, paths/curves/arcs, transforms, simple CSS, gradients, clipping, masks, bounded local references, owned bitmap text, and supersampling.
24
+ - Security: no external URL/entity/script/image/document load; byte, pixel, frame, recursion, path, node, sample, operation, and output limits.
25
+ - Integration: ReadImage uses only owned media paths for supported bounded previews; no direct-compressed escape hatch is used when an owned decoder exists.
26
+ - Intentional incompatibilities: unsupported profiles fail explicitly or follow the documented still/first-frame policy. The stack does not claim every JPEG/WebP/SVG extension.
27
+
28
+ ## Normative and permitted inputs
29
+
30
+ | Source | Revision/date | Purpose | Terms reviewed by | Evidence path |
31
+ | --- | --- | --- | --- | --- |
32
+ | Xeno proprietary migration specification | 2026-07-12 | Media ownership, compatibility, security, and release gates | Engineering; counsel pending | `switch-to-proprietary.md` |
33
+ | RFC 1950, RFC 1951, RFC 1952 | published RFC revisions | zlib, DEFLATE, and gzip framing/bitstream behavior | Engineering; counsel pending | public RFC text |
34
+ | W3C PNG Third Edition | accessed 2026-07-12 | PNG chunk, color, filtering, interlace, and error behavior | Engineering; counsel pending | `https://www.w3.org/TR/png-3/` |
35
+ | ITU-T T.81 and T.871 | public recommendations | JPEG DCT/Huffman and JFIF behavior | Engineering; counsel pending | ITU public recommendations |
36
+ | GIF89a specification | public specification | GIF blocks, LZW, interlace, control extensions, and animation | Engineering; counsel pending | public GIF89a text |
37
+ | RFC 6386 | source SHA-256 `e89d0369d8e8c2ab0b080ef142bd27bebb2f228285ea34bd35d55b8e623d3259` | VP8 syntax, probabilities, prediction, transforms, and filtering | Engineering; counsel pending | generated-table source metadata |
38
+ | Google WebP RIFF and lossless specifications | accessed 2026-07-12 | WebP container, VP8L, ALPH, metadata, and animation | Engineering; counsel pending | public Google specifications |
39
+ | W3C SVG 2 and SVG Paths | accessed 2026-07-12 | vector geometry, transforms, rendering, gradients, clipping, masks, and text contract | Engineering; counsel pending | public W3C specifications |
40
+ | Existing Xeno ReadImage contracts | candidate working tree | preview lifecycle, transport limits, private artifacts, and source immutability | Engineering | `src/tools/read-image.ts`, focused tests |
41
+
42
+ ## Contributor source-exposure disclosure
43
+
44
+ | Contributor | Inspected replaced source? | Date/range | Separation or review decision | Counsel reference |
45
+ | --- | --- | --- | --- | --- |
46
+ | Codex implementation assistant | No third-party codec implementation source was inspected. Public specifications and black-box oracle outputs were used. | 2026-07-12 | Independent source/provenance review required | Pending |
47
+ | Codex implementation assistant | Xeno-owned sibling SVG files were inspected only to determine that they depended on browser DOM/canvas or were stubs; no source was copied into this implementation. | 2026-07-12 | Cross-repository Xeno ownership must be independently confirmed | Pending |
48
+ | Human contributors | Disclosure not yet collected | Pending | Must be completed before capability approval | Pending |
49
+
50
+ ## Implementation log
51
+
52
+ | Date (UTC) | Decision | Contract/source basis | Author | Evidence path |
53
+ | --- | --- | --- | --- | --- |
54
+ | 2026-07-12 | Replace Node zlib with owned bounded DEFLATE/zlib/gzip logic | FR-052 | Codex implementation assistant | `src/media/xeno-deflate.ts` |
55
+ | 2026-07-12 | Complete PNG profile and deterministic encode | FR-051 | Codex implementation assistant | `src/media/xeno-raster.ts`, `tests/xeno-png.test.mjs` |
56
+ | 2026-07-12 | Implement baseline/progressive JPEG, Exif, CMYK, and YCCK | FR-053 | Codex implementation assistant | `src/media/xeno-jpeg.ts` |
57
+ | 2026-07-12 | Implement full bounded GIF frame composition and first-frame policy | FR-054 | Codex implementation assistant | `src/media/xeno-gif.ts` |
58
+ | 2026-07-12 | Generate normative VP8 tables from a pinned RFC hash and implement VP8 key-frame decode | FR-055 | Codex implementation assistant | `scripts/generate-vp8-tables.mjs`, `src/media/xeno-vp8*.ts` |
59
+ | 2026-07-12 | Implement VP8L, ALPH, metadata, container validation, and first-frame animation | FR-055 | Codex implementation assistant | `src/media/xeno-webp.ts` |
60
+ | 2026-07-12 | Add bounded RGB matrix/TRC ICC and shared Exif orientation | media color/metadata contract | Codex implementation assistant | `src/media/xeno-image-metadata.ts` |
61
+ | 2026-07-12 | Replace the line-only SVG subset with the approved secure owned renderer | FR-056 through FR-058 | Codex implementation assistant | `src/media/xeno-svg.ts`, `src/media/xeno-svg-geometry.ts` |
62
+ | 2026-07-12 | Remove stale direct-compressed claims and document exact profiles | FR-050 | Codex implementation assistant | `docs/owned-media-matrix.md`, README, tool description |
63
+ | 2026-07-12 | Classify black-box oracle tools and external corpora while preserving production exclusion | ownership policy | Codex implementation assistant | ownership policy revision 10 |
64
+ | 2026-07-12 | Audit and reject current `xeno-lib` media integration because its still-image/vector graph remains external-backed | cross-repository ownership gate | Codex implementation assistant | `docs/xeno-lib-media-boundary.md` |
65
+ | 2026-07-12 | Run pinned external PNG/JPEG/WebP/SVG corpora and fix WebP unknown-chunk interoperability | media conformance and WebP RIFF specification | Codex implementation assistant | `docs/external-media-corpora.md`, `docs/compliance/external-media-corpora.json` |
66
+ | 2026-07-12 | Run a deterministic 60-second external-corpus mutation campaign | media fuzz engineering gate | Codex implementation assistant | `scripts/fuzz-external-media.mjs`, `docs/compliance/external-media-fuzz.json` |
67
+ | 2026-07-12 | Reacquire every pinned corpus, reproduce all digests/outcomes, and run a separate five-minute deterministic mutation campaign | sustained local media engineering evidence | Codex implementation assistant | `docs/compliance/external-media-fuzz-sustained.json` |
68
+ | 2026-07-12 | Add a supervised V8 precise-coverage feedback loop with deterministic mutation, per-codec gates, current-case persistence, and tested idle/hard watchdogs across all nine claimed decoder paths | feedback-guided fuzz engineering gate | Codex implementation assistant | `scripts/fuzz-external-media-coverage*.mjs`, `tests/external-media-coverage-fuzz.test.mjs`, `docs/compliance/external-media-fuzz-coverage-sustained.json` |
69
+
70
+ ## AI assistance and test-oracle use
71
+
72
+ - Models/tools used: OpenAI Codex coding agent, local PowerShell, TypeScript, tsup, and Node test runner.
73
+ - Prompt or retained prompt-summary path: active Xeno proprietary migration goal and `switch-to-proprietary.md`.
74
+ - Black-box oracles: Node zlib, Pillow, ImageMagick, libwebp, and libvpx were used only to generate or compare isolated fixture outputs. Their implementations are not imported, linked, bundled, dynamically discovered, or invoked by production code.
75
+ - Normative generation: RFC 6386 numeric tables are generated from a caller-supplied source with an exact pinned SHA-256. Reproduction on 2026-07-12 produced checked-in SHA-256 `89f8368f813f8c07cfb070c0c070d8ca1179d4051ca248e97de71125c2ca5d9e` byte-for-byte.
76
+ - Confirmation that no third-party implementation entered the prompt: no codec source was supplied or inspected; oracle pixels/containers and public specification text were used.
77
+ - Human review performed: pending.
78
+
79
+ ## Verification evidence
80
+
81
+ - Focused media/read-image/fuzz-supervisor gate: 69 passed, 0 failed after adding feedback-guided coverage and watchdog regressions.
82
+ - External corpus engineering run: PNGSuite 60/60 accepted; libjpeg-turbo 2 supported images accepted and 2 documented unsupported profiles rejected; WebM Project WebP 130/131 accepted with the intentionally truncated vector rejected; all 525 unmodified W3C SVG files rejected at the secure-subset boundary. Exact per-file hashes and outcomes are recorded in `docs/compliance/external-media-corpora.json`.
83
+ - External mutation engineering run: 48,334 iterations in 60 seconds across PNG/JPEG/WebP/SVG, zero output invariant failures, and peak RSS 302,944,256 bytes. This does not replace the independently approved sustained fuzz gate.
84
+ - Independent corpus reacquisition rerun: exact upstream revisions plus W3C archive SHA reproduce all four recorded corpus digests and all 720 accepted/rejected outcomes with zero expectation failures.
85
+ - Five-minute mutation engineering run: 279,559 iterations across PNG/JPEG/WebP/SVG, zero output invariant failures, and peak RSS 321,949,696 bytes. Report SHA-256 is `5d22c7acc275d6e43ec83feebc61e8576e048ee930eae735b7164565c456c604`. This remains deterministic engineering evidence, not independently approved coverage-guided fuzzing.
86
+ - Five-minute feedback-guided engineering run: 78,978 mutations across PNG/JPEG/WebP/SVG/GIF/BMP/PBM/PGM/PPM, 1,415 unique executed owned-bundle ranges, 232 retained coverage-increasing inputs, zero output invariant failures, zero slow inputs, zero watchdog terminations, and 459,878,400-byte peak RSS. Report SHA-256 is `4fae930893f14e7170da85e9bc2e621f340cbc327f5c863fac3139b91113b018`; formal approval remains false pending independent threshold, sanitizer, corpus, and triage review.
87
+ - Paired local SDK/CLI candidate tarballs passed clean installation, ownership parity, canvas exclusion, residue scan, packaged command/benchmark checks, and the owned preview doctor check before the strict verifier stopped on the unsigned PTY release gate. Candidate hashes and scope are in the CLI `docs/compliance/paired-package-candidate.md` record.
88
+ - Full SDK regression: 501 passed, 2 platform-dependent skips, 0 failures.
89
+ - Linked CLI integration: source and CLI typechecks pass, the CLI bundle builds, and Vitest reports 163 files with 1,490 passed, 1 skipped, and 0 failures.
90
+ - Type verification: `npm run typecheck` and `npm run typecheck:tests` pass.
91
+ - Ownership proof: artifact-inclusive SDK audit reports pre-P1, target P2, 823 component records, and 0 violations. Capability remains pre-P1 because P1 evidence gates are intentionally not approved.
92
+ - Runtime exclusion scan: no `node:zlib`, canvas package, resvg, sharp, Jimp, React DOM, or equivalent media fallback in the scanned SDK production source/manifest/lock graph.
93
+ - Source hashes:
94
+ - `xeno-deflate.ts`: `61badde76048cba77a432a9a1e737de4fe49ffd6b877833b76062133851b0ae3`
95
+ - `xeno-raster.ts`: `6a7069fdd3dc6c4045feff36731fdf942fdaba71876b95b19cc8b2db49fc3ec6`
96
+ - `xeno-image-metadata.ts`: `544e1b8e14b30c1948a79887495077727fea62cbcea118edf3a108ebf8cf7973`
97
+ - `xeno-jpeg.ts`: `ad57118e4d35c29d8c5bb69f98b0be0f2442f500dc78cdf14f1f5e9330001280`
98
+ - `xeno-gif.ts`: `bda46489a77176b7ef910ab980b19468ea21a581db44333e71899495120998be`
99
+ - `xeno-vp8.ts`: `e0808f97bc9c2c727fc22e91fc0c7660b0b2ebd597bb44593a7afd43975fca07`
100
+ - `xeno-vp8-tables.ts`: `89f8368f813f8c07cfb070c0c070d8ca1179d4051ca248e97de71125c2ca5d9e`
101
+ - `xeno-webp.ts`: `54f65311182391c67759361b49a7ab2b8cd744ce9034bdc1ee6b88b33b0faee3`
102
+ - `xeno-svg-geometry.ts`: `89fcbc0ddf7ae852cfa9f7c0323ff3da7e510a4581288c76c40060ae80abbcb0`
103
+ - `xeno-svg.ts`: `edc1f03f20208efd26fa3a40afff039fccfe87936d1b5a60fb8b5a9c60eab638`
104
+ - `generate-vp8-tables.mjs`: `00ce9cac50fcf6e12a059da6a0744cb807e9dbda0c4e3d2df93ca9b634d1f9e4`
105
+ - `run-external-media-corpora.mjs`: `5e4c9910cd5fc403d331b5ca382b100cb367f0008c8f5275106e73301541232c`
106
+ - `external-media-corpora.json`: `a98533c06ff3929cc7b4d961739536f7f7532ad6583429f948c9f5e0c2477084`
107
+ - `fuzz-external-media.mjs`: `0c3dc2c1baf15b8325fc7b9692485947e28521269c4304289883c1b025584072`
108
+ - `external-media-fuzz.json`: `a2c4e32e9ebc914595d300636538d5f6a36f786b10b8cbff1374c71f444510cd`
109
+ - `external-media-fuzz-sustained.json`: `5d22c7acc275d6e43ec83feebc61e8576e048ee930eae735b7164565c456c604`
110
+ - `read-image.ts`: `151f009e882bd561345d380df204e8b8add56db081e89ee09d1b234f649e28e2`
111
+ - `fuzz-external-media-coverage.mjs`: `14e383b65995ab3f942c0411e070843cd18c16999373c9943bff1141c76d0fcd`
112
+ - `fuzz-external-media-coverage-worker.mjs`: `fd557232dc38ea6b2ce6b95f79cde983f417d35bb49ecf39383f9b1f1d3f6636`
113
+ - `external-media-fuzz-coverage-sustained.json`: `4fae930893f14e7170da85e9bc2e621f340cbc327f5c863fac3139b91113b018`
114
+
115
+ ## Open legal, provenance, and engineering questions
116
+
117
+ - Independent clean-room/source-structure review is pending.
118
+ - Contributor source-exposure disclosures and counsel disposition are pending.
119
+ - JPEG, GIF history, VP8/WebP, ICC, DEFLATE, SVG/font rendering, and specification-table rights require counsel review before public claims.
120
+ - The committed tests plus deterministic and feedback-guided five-minute campaigns are not self-approving evidence; independent reviewers must approve coverage/duration thresholds, native sanitizer and release-architecture scope, corpus terms, and triage policy.
121
+ - Pinned external corpora are selected, classified, hashed, and run for engineering evidence, but their terms/counsel disposition, independent rerun, pixel-oracle comparisons, and an approved secure-SVG subset corpus remain pending.
122
+ - ARM, macOS, signed release, and self-contained-product artifact coverage remain outside this engineering record. A local paired npm clean-install audit reached only the expected unsigned-PTY blocker and is not a completed release gate.
123
+ - `xeno-lib` reconciliation is decided and documented in `docs/xeno-lib-media-boundary.md`: its current `image` and `vtracer` bootstrap-engine graph is not accepted as a production owner. Future integration remains gated on a separately proprietary graph and full cross-repository evidence.
124
+
125
+ ## Handoff
126
+
127
+ - Engineering implementation complete for documented SDK matrix: yes
128
+ - Evidence complete: no
129
+ - Capability gate may be marked achieved: no
130
+ - Ready for independent provenance review: yes, after corpus licensing/classification and contributor disclosure collection
131
+ - Author/date: Codex implementation assistant, 2026-07-12
@@ -1,50 +1,50 @@
1
- # Independent Provenance Review: Xeno-Owned Media Stack
2
-
3
- ## Review identity
4
-
5
- - Component: Xeno-owned compression, raster codecs, metadata/color conversion, and secure SVG renderer
6
- - Replacement milestone: PROPRIETARY-MEDIA-1
7
- - Implementation record path: `ownership/evidence/PROPRIETARY-MEDIA-1/implementation-record.md`
8
- - Candidate revision: `a59066e477c904e077b1aceed8a65fa9c2767535` plus recorded working-tree changes
9
- - Reviewer: pending
10
- - Domain reviewer(s): pending codec, color-management, parser-security, and intellectual-property reviewers
11
- - Review date (UTC): pending
12
- - Reviewer independent of implementation: pending
13
-
14
- ## Evidence checks
15
-
16
- - [ ] The capability matrix predates or is independently reconciled with the implementation.
17
- - [ ] Normative sources, revisions, hashes, and permitted uses are complete.
18
- - [ ] Contributor source-exposure disclosures are complete.
19
- - [ ] No copied implementation source, comments, tests, identifiers, non-normative constants, or distinctive internal structure were found.
20
- - [ ] RFC-derived numeric tables and specification-copying rights have an explicit counsel disposition.
21
- - [ ] Production source, bundles, package, lock, and installed graph have no ambient decoder, canvas, zlib, or hidden fallback.
22
- - [ ] PNG/JPEG/GIF/VP8/VP8L/WebP behavior passes approved independently sourced conformance corpora.
23
- - [ ] SVG geometry, rendering, XML/CSS security, clipping/masking, text policy, and unsupported-feature failures are independently reviewed.
24
- - [ ] Byte, allocation, recursion, frame, CPU, and output limits hold under adversarial review.
25
- - [ ] The approved sustained fuzz-duration gate completes with no unresolved crash, hang, or excessive allocation.
26
- - [ ] Black-box oracle tools and fixtures are classified and proven production-excluded.
27
- - [ ] Release tarball, clean install, CLI integration, and standalone artifacts agree with the ownership inventory.
28
- - [ ] Patent, trademark, specification-license, and public product-language questions have counsel approval.
29
-
30
- ## Verification summary
31
-
32
- | Gate | Evidence | Result | Notes |
33
- | --- | --- | --- | --- |
34
- | Focused media behavior | 62 committed tests | engineering pass | format matrix, metadata, malformed inputs, and ReadImage covered |
35
- | SDK regression | full Node suite | engineering pass | 501 pass, 2 platform skips, 0 failures |
36
- | Linked CLI integration | typechecks, bundle build, full Vitest suite | engineering pass | 163 files; 1,490 pass, 1 skip, 0 failures |
37
- | Type/build | source/test typechecks and tsup build | engineering pass | no type or build failures |
38
- | Normative VP8 generation | pinned RFC source and byte comparison | engineering pass | generated file reproduced exact SHA-256 |
39
- | Runtime package/source exclusion | ownership audit and targeted scan | engineering pass | 823 artifact-inclusive records, 0 violations |
40
- | Independent corpus and sustained fuzz | not yet run | pending | required before capability approval |
41
- | Provenance and legal | implementation record only | pending | independent reviewer and counsel required |
42
-
43
- ## Decision
44
-
45
- - Engineering provenance decision: needs-review
46
- - Capability gate may be marked achieved: no
47
- - Public clean-room/proprietary claim approved by this review: no
48
- - Required follow-up: classify and run approved independent corpora, complete sustained fuzzing, collect contributor disclosures, perform independent source/security/color review, audit release and installed artifacts, reconcile xeno-lib, and attach counsel disposition.
49
- - Reviewer signature/date: pending
50
- - Counsel approval reference: pending
1
+ # Independent Provenance Review: Xeno-Owned Media Stack
2
+
3
+ ## Review identity
4
+
5
+ - Component: Xeno-owned compression, raster codecs, metadata/color conversion, and secure SVG renderer
6
+ - Replacement milestone: PROPRIETARY-MEDIA-1
7
+ - Implementation record path: `ownership/evidence/PROPRIETARY-MEDIA-1/implementation-record.md`
8
+ - Candidate revision: `a59066e477c904e077b1aceed8a65fa9c2767535` plus recorded working-tree changes
9
+ - Reviewer: pending
10
+ - Domain reviewer(s): pending codec, color-management, parser-security, and intellectual-property reviewers
11
+ - Review date (UTC): pending
12
+ - Reviewer independent of implementation: pending
13
+
14
+ ## Evidence checks
15
+
16
+ - [ ] The capability matrix predates or is independently reconciled with the implementation.
17
+ - [ ] Normative sources, revisions, hashes, and permitted uses are complete.
18
+ - [ ] Contributor source-exposure disclosures are complete.
19
+ - [ ] No copied implementation source, comments, tests, identifiers, non-normative constants, or distinctive internal structure were found.
20
+ - [ ] RFC-derived numeric tables and specification-copying rights have an explicit counsel disposition.
21
+ - [ ] Production source, bundles, package, lock, and installed graph have no ambient decoder, canvas, zlib, or hidden fallback.
22
+ - [ ] PNG/JPEG/GIF/VP8/VP8L/WebP behavior passes approved independently sourced conformance corpora.
23
+ - [ ] SVG geometry, rendering, XML/CSS security, clipping/masking, text policy, and unsupported-feature failures are independently reviewed.
24
+ - [ ] Byte, allocation, recursion, frame, CPU, and output limits hold under adversarial review.
25
+ - [ ] The approved sustained fuzz-duration gate completes with no unresolved crash, hang, or excessive allocation.
26
+ - [ ] Black-box oracle tools and fixtures are classified and proven production-excluded.
27
+ - [ ] Release tarball, clean install, CLI integration, and standalone artifacts agree with the ownership inventory.
28
+ - [ ] Patent, trademark, specification-license, and public product-language questions have counsel approval.
29
+
30
+ ## Verification summary
31
+
32
+ | Gate | Evidence | Result | Notes |
33
+ | --- | --- | --- | --- |
34
+ | Focused media behavior | 62 committed tests | engineering pass | format matrix, metadata, malformed inputs, and ReadImage covered |
35
+ | SDK regression | full Node suite | engineering pass | 501 pass, 2 platform skips, 0 failures |
36
+ | Linked CLI integration | typechecks, bundle build, full Vitest suite | engineering pass | 163 files; 1,490 pass, 1 skip, 0 failures |
37
+ | Type/build | source/test typechecks and tsup build | engineering pass | no type or build failures |
38
+ | Normative VP8 generation | pinned RFC source and byte comparison | engineering pass | generated file reproduced exact SHA-256 |
39
+ | Runtime package/source exclusion | ownership audit and targeted scan | engineering pass | 823 artifact-inclusive records, 0 violations |
40
+ | Independent corpus and sustained fuzz | not yet run | pending | required before capability approval |
41
+ | Provenance and legal | implementation record only | pending | independent reviewer and counsel required |
42
+
43
+ ## Decision
44
+
45
+ - Engineering provenance decision: needs-review
46
+ - Capability gate may be marked achieved: no
47
+ - Public clean-room/proprietary claim approved by this review: no
48
+ - Required follow-up: classify and run approved independent corpora, complete sustained fuzzing, collect contributor disclosures, perform independent source/security/color review, audit release and installed artifacts, reconcile xeno-lib, and attach counsel disposition.
49
+ - Reviewer signature/date: pending
50
+ - Counsel approval reference: pending
@@ -1,86 +1,86 @@
1
- # Clean-Room Implementation Record: Xeno PTY Runtime
2
-
3
- ## Identity
4
-
5
- - Component: Xeno-owned native PTY binding, artifact loader, and UnifiedExec adapter
6
- - Replacement milestone: PROPRIETARY-PTY-1
7
- - Repository and paths: `xeno-agent-cli/apps/xeno-agent-cli/native/xeno-pty/`, `apps/xeno-agent-cli/src/terminal/xeno-pty-*.ts`
8
- - Record owner: Xeno engineering, final owner assignment pending
9
- - Implementer(s): Codex implementation assistant; human native-code review pending
10
- - Contract author(s): Xeno engineering requirements in `switch-to-proprietary.md`
11
- - Started at (UTC): 2026-07-12
12
- - Candidate revision: `87ae64b55aa1b8c2e126294e717b229e0945db65` plus recorded working-tree changes
13
- - Status: Windows x64, Linux x64, and Linux arm64 engineering complete; remaining architecture and release evidence incomplete
14
-
15
- ## Frozen behavioral contract
16
-
17
- - Public API and observable behavior: spawn an interactive terminal with file, argument, cwd, environment, column, and row inputs; emit ordered UTF-8 data and exactly one exit event; accept input; resize; perform graceful interruption and forced process-tree termination.
18
- - Compatibility fixtures: `tests/xeno-pty-integration.test.ts`, `tests/xeno-pty-adapter.test.ts`, and `tests/xeno-pty-loader.test.ts`.
19
- - Intentional incompatibilities and versioning decision: the adapter reports `xeno-conpty` or `xeno-posix-pty`; unavailable platforms explicitly retain pipe mode and are not reported as interactive PTY support.
20
- - Security and resource limits: direct stable C N-API only; 256-event native queue with producer backpressure; 1 MiB pre-listener output cap; SHA-256 and Ed25519 trust verification before loading; Windows Job Object kill-on-close tree ownership.
21
- - Supported platforms and architectures: Windows x64, Linux x64, and Linux arm64 are implemented and locally verified. Windows arm64 and macOS x64/arm64 are configured but unobserved and remain outside the achieved capability gate.
22
-
23
- ## Normative and permitted inputs
24
-
25
- | Source | Revision/date | Purpose | Terms reviewed by | Evidence path |
26
- | --- | --- | --- | --- | --- |
27
- | Xeno proprietary migration specification | 2026-07-12 | PTY behavior, ownership, packaging, and release constraints | Engineering; counsel pending | `switch-to-proprietary.md` |
28
- | Microsoft CreatePseudoConsole documentation | accessed 2026-07-12 | ConPTY stream, resize, and lifecycle contract | Engineering | `https://learn.microsoft.com/windows/console/createpseudoconsole` |
29
- | Microsoft Creating a Pseudoconsole Session documentation | updated 2025-08-13 | Pipe directions, STARTUPINFOEX, process creation, and close ordering | Engineering | `https://learn.microsoft.com/windows/console/creating-a-pseudoconsole-session` |
30
- | Microsoft CreateProcessW and Job Object documentation | accessed 2026-07-12 | Child startup handles and process-tree containment | Engineering | Microsoft Learn Win32 API documentation |
31
- | Linux man-pages `forkpty(3)`, `ioctl_tty(2)`, `setsid(2)`, and `kill(2)` | accessed 2026-07-12 | PTY creation, terminal resize, session/process-group ownership, and signal delivery | Engineering | public Linux man-pages documentation |
32
- | Node stable C N-API headers | Node 24.13.1, N-API v8 target | ABI contract without `node-addon-api` | Engineering | locally installed Node headers and public Node API documentation |
33
- | Xeno UnifiedExec contract | candidate working tree | Product-side PTY adapter behavior | Engineering | `xeno-agent-sdk/src/runtime/unified-exec.ts` |
34
-
35
- ## Contributor source-exposure disclosure
36
-
37
- | Contributor | Inspected replaced source? | Date/range | Separation or review decision | Counsel reference |
38
- | --- | --- | --- | --- | --- |
39
- | Codex implementation assistant | No `node-pty` or `node-addon-api` implementation source was inspected. Work used Xeno contracts and Microsoft/Node public API documentation. | 2026-07-12 | Independent native and provenance review required | Pending |
40
- | Human contributors | Disclosure not yet collected | Pending | Must be completed before capability approval | Pending |
41
-
42
- ## Implementation log
43
-
44
- | Date (UTC) | Decision | Contract/source basis | Author | Evidence path |
45
- | --- | --- | --- | --- | --- |
46
- | 2026-07-12 | Bind ConPTY directly through stable C N-API | FR-030 through FR-035 | Codex implementation assistant | `native/xeno-pty/src/xeno_pty_win.cpp` |
47
- | 2026-07-12 | Bind Linux/macOS PTY primitives directly through stable C N-API | FR-032 through FR-036 | Codex implementation assistant | `native/xeno-pty/src/xeno_pty_posix.cpp` |
48
- | 2026-07-12 | Own each POSIX PTY as a session/process group and drain output before settlement | complete-tree termination and exactly-once lifecycle contract | Codex implementation assistant | POSIX native source and integration tests |
49
- | 2026-07-12 | Null inherited standard handles before pseudoconsole attachment | Captured-output conformance and CreateProcess startup contract | Codex implementation assistant | `xeno_pty_win.cpp`, integration tests |
50
- | 2026-07-12 | Use one bounded ordered native event channel and StringDecoder bridge | FR-034 and FR-036 | Codex implementation assistant | native source and `xeno-pty-adapter.ts` |
51
- | 2026-07-12 | Join and destroy native state at exit settlement | Handle-lifecycle and exactly-once requirements | Codex implementation assistant | native diagnostics and 25-cycle soak |
52
- | 2026-07-12 | Verify ABI, hash, platform, architecture, and Ed25519 trust before load | FR-038 | Codex implementation assistant | `xeno-pty-loader.ts`, manifest signer |
53
- | 2026-07-12 | Forbid `node-pty` and `node-addon-api` reintroduction | Phase 3 dependency gate | Codex implementation assistant | ownership policy revision 5 |
54
- | 2026-07-12 | Resolve Windows N-API exports from the actual host process instead of importing `node.exe` | renamed/self-contained Node hosts must load the same owned addon safely | Codex implementation assistant | `xeno_pty_win.cpp`, PE import verifier, packaged Windows doctor smoke |
55
- | 2026-07-12 | Standardize release Windows builds on MSVC and reject non-platform PE imports | exclude GNU runtime linkage and undeclared auxiliary DLLs | Codex implementation assistant | `build-windows.ps1`, `verify-pe-imports.mjs` |
56
-
57
- ## AI assistance
58
-
59
- - Models/tools used: OpenAI Codex coding agent, local PowerShell, Microsoft C/C++ 19.44, Node.js, Vitest, and an isolated Debian Docker verifier.
60
- - Prompt or retained prompt-summary path: active Xeno proprietary migration goal and `switch-to-proprietary.md`.
61
- - Confirmation that no third-party source entered the prompt: no replaced-package implementation source was supplied or inspected; public platform/API documentation and Xeno-owned contracts were used.
62
- - Human review performed: pending.
63
-
64
- ## Verification evidence
65
-
66
- - Unit and compatibility tests: 13 focused tests pass on Windows; 12 execute and pass in a clean Linux Docker dependency environment with one Windows-only local-load assertion skipped.
67
- - Conformance corpus: TTY startup, ordered output, Unicode input/output, resize protocol, foreground-to-background PID preservation, Ctrl+C delivery, exactly-once exit, graceful-to-force escalation, early-output bound, descendant cleanup, tampered hash rejection, unsigned-install rejection.
68
- - Fuzz campaign and duration: deterministic malformed-input and lifecycle/state campaigns pass 100 iterations on the current Windows x64 artifact in 10.064 seconds, 100 iterations on Linux x64, 100 iterations on Linux arm64 under emulation, and 250 Linux x64 iterations under AddressSanitizer and UndefinedBehaviorSanitizer. Coverage-guided native fuzzing remains required before capability approval.
69
- - Security/resource-limit tests: finite native event queue, bounded early buffer, hash mismatch rejection, malformed manifest rejection, installed unsigned artifact rejection, and isolated Linux AddressSanitizer/UndefinedBehaviorSanitizer smoke plus stress execution.
70
- - Cross-platform results: Windows x64, Linux x64, and Linux arm64 local/container pass; Windows arm64 and macOS x64/arm64 matrix runs pending.
71
- - Performance comparison: 25 rapid real-PTY cycles pass with native active-state count returning to zero. The current Windows MSVC artifact measures startup p50/p95 35.31/359.15 ms and approximately 2.6 MB/s observed output; the Linux x64 baseline measures p50/p95 14.76/17.55 ms and approximately 32.6 MB/s. Linux arm64 under emulation measures p50/p95 556.17/612.07 ms and approximately 1.64 MB/s. The dependency-free benchmark enforces conservative CI limits of 2,000 ms p95 and 1 MiB/s; a product-approved comparative release envelope remains pending.
72
- - Bundle/native/SBOM evidence: artifact audit records Xeno-owned Windows x64 SHA-256 `91d9a464823091603d784cbc3a570b8a0e514576eeb4b8fb2aabcdcbb64bccad` from source SHA-256 `9f6f6248f35f2f6b767b153f66670d5ed8f95cb7d6242c77c652efe5cca2d038`, Linux x64 SHA-256 `a93757b552cb9236fe33773228072df270659d6a015a92fb96d21a9d22c5f2cb`, and Linux arm64 SHA-256 `07f660ac0c32ac7a2900f3abdfa12550f603880f02a1763a12a63064fe802006`; both Linux artifacts derive from source SHA-256 `6ba69e62cf0c0765546afa19f1820c1cc7f64f452802718c20b4a117d6c8f9c6`. The Windows PE imports only `KERNEL32.dll`; two local native rebuilds are byte-identical. Clean Debian candidates execute Linux x64 and Linux arm64 self-contained payloads. The exact cross-built Windows x64 payload (`21386d53c04116f4904da186c873089aac4db57c02281da2c14f615a50a9b616`) executes on Windows with a byte-matching extracted addon and healthy ConPTY diagnostics. The Linux arm64 payload SHA-256 is `92a8583433aec8415c1405b56ad5afe39f7560c216eac4e46684fb03041e6346`. Paired release verification correctly stops at the strict unsigned-native gate; see `docs/compliance/linux-package-candidate.md` and `docs/compliance/linux-arm64-package-candidate.md`. Clean signed-install smoke remains pending.
73
-
74
- ## Open legal or provenance questions
75
-
76
- - Patents/specification terms: operating-system and Node API boundary review pending.
77
- - Trademarks: historical replaced-package names remain only in migration evidence and forbidden-package rules.
78
- - Export or distribution constraints: native binary distribution and signing review pending.
79
- - Other: release trust store is empty and both exercised prebuilds are intentionally marked `unsigned-development`; unobserved architecture CI, coverage-guided fuzzing, independent review, contributor disclosures, and counsel disposition remain mandatory.
80
-
81
- ## Handoff
82
-
83
- - Implementation complete: Windows x64, Linux x64, and Linux arm64 yes; complete PTY milestone no
84
- - Evidence complete: no
85
- - Ready for independent provenance review: after signing, coverage-guided fuzzing, and remaining cross-platform package evidence
86
- - Author/date: Codex implementation assistant, 2026-07-12
1
+ # Clean-Room Implementation Record: Xeno PTY Runtime
2
+
3
+ ## Identity
4
+
5
+ - Component: Xeno-owned native PTY binding, artifact loader, and UnifiedExec adapter
6
+ - Replacement milestone: PROPRIETARY-PTY-1
7
+ - Repository and paths: `xeno-agent-cli/apps/xeno-agent-cli/native/xeno-pty/`, `apps/xeno-agent-cli/src/terminal/xeno-pty-*.ts`
8
+ - Record owner: Xeno engineering, final owner assignment pending
9
+ - Implementer(s): Codex implementation assistant; human native-code review pending
10
+ - Contract author(s): Xeno engineering requirements in `switch-to-proprietary.md`
11
+ - Started at (UTC): 2026-07-12
12
+ - Candidate revision: `87ae64b55aa1b8c2e126294e717b229e0945db65` plus recorded working-tree changes
13
+ - Status: Windows x64, Linux x64, and Linux arm64 engineering complete; remaining architecture and release evidence incomplete
14
+
15
+ ## Frozen behavioral contract
16
+
17
+ - Public API and observable behavior: spawn an interactive terminal with file, argument, cwd, environment, column, and row inputs; emit ordered UTF-8 data and exactly one exit event; accept input; resize; perform graceful interruption and forced process-tree termination.
18
+ - Compatibility fixtures: `tests/xeno-pty-integration.test.ts`, `tests/xeno-pty-adapter.test.ts`, and `tests/xeno-pty-loader.test.ts`.
19
+ - Intentional incompatibilities and versioning decision: the adapter reports `xeno-conpty` or `xeno-posix-pty`; unavailable platforms explicitly retain pipe mode and are not reported as interactive PTY support.
20
+ - Security and resource limits: direct stable C N-API only; 256-event native queue with producer backpressure; 1 MiB pre-listener output cap; SHA-256 and Ed25519 trust verification before loading; Windows Job Object kill-on-close tree ownership.
21
+ - Supported platforms and architectures: Windows x64, Linux x64, and Linux arm64 are implemented and locally verified. Windows arm64 and macOS x64/arm64 are configured but unobserved and remain outside the achieved capability gate.
22
+
23
+ ## Normative and permitted inputs
24
+
25
+ | Source | Revision/date | Purpose | Terms reviewed by | Evidence path |
26
+ | --- | --- | --- | --- | --- |
27
+ | Xeno proprietary migration specification | 2026-07-12 | PTY behavior, ownership, packaging, and release constraints | Engineering; counsel pending | `switch-to-proprietary.md` |
28
+ | Microsoft CreatePseudoConsole documentation | accessed 2026-07-12 | ConPTY stream, resize, and lifecycle contract | Engineering | `https://learn.microsoft.com/windows/console/createpseudoconsole` |
29
+ | Microsoft Creating a Pseudoconsole Session documentation | updated 2025-08-13 | Pipe directions, STARTUPINFOEX, process creation, and close ordering | Engineering | `https://learn.microsoft.com/windows/console/creating-a-pseudoconsole-session` |
30
+ | Microsoft CreateProcessW and Job Object documentation | accessed 2026-07-12 | Child startup handles and process-tree containment | Engineering | Microsoft Learn Win32 API documentation |
31
+ | Linux man-pages `forkpty(3)`, `ioctl_tty(2)`, `setsid(2)`, and `kill(2)` | accessed 2026-07-12 | PTY creation, terminal resize, session/process-group ownership, and signal delivery | Engineering | public Linux man-pages documentation |
32
+ | Node stable C N-API headers | Node 24.13.1, N-API v8 target | ABI contract without `node-addon-api` | Engineering | locally installed Node headers and public Node API documentation |
33
+ | Xeno UnifiedExec contract | candidate working tree | Product-side PTY adapter behavior | Engineering | `xeno-agent-sdk/src/runtime/unified-exec.ts` |
34
+
35
+ ## Contributor source-exposure disclosure
36
+
37
+ | Contributor | Inspected replaced source? | Date/range | Separation or review decision | Counsel reference |
38
+ | --- | --- | --- | --- | --- |
39
+ | Codex implementation assistant | No `node-pty` or `node-addon-api` implementation source was inspected. Work used Xeno contracts and Microsoft/Node public API documentation. | 2026-07-12 | Independent native and provenance review required | Pending |
40
+ | Human contributors | Disclosure not yet collected | Pending | Must be completed before capability approval | Pending |
41
+
42
+ ## Implementation log
43
+
44
+ | Date (UTC) | Decision | Contract/source basis | Author | Evidence path |
45
+ | --- | --- | --- | --- | --- |
46
+ | 2026-07-12 | Bind ConPTY directly through stable C N-API | FR-030 through FR-035 | Codex implementation assistant | `native/xeno-pty/src/xeno_pty_win.cpp` |
47
+ | 2026-07-12 | Bind Linux/macOS PTY primitives directly through stable C N-API | FR-032 through FR-036 | Codex implementation assistant | `native/xeno-pty/src/xeno_pty_posix.cpp` |
48
+ | 2026-07-12 | Own each POSIX PTY as a session/process group and drain output before settlement | complete-tree termination and exactly-once lifecycle contract | Codex implementation assistant | POSIX native source and integration tests |
49
+ | 2026-07-12 | Null inherited standard handles before pseudoconsole attachment | Captured-output conformance and CreateProcess startup contract | Codex implementation assistant | `xeno_pty_win.cpp`, integration tests |
50
+ | 2026-07-12 | Use one bounded ordered native event channel and StringDecoder bridge | FR-034 and FR-036 | Codex implementation assistant | native source and `xeno-pty-adapter.ts` |
51
+ | 2026-07-12 | Join and destroy native state at exit settlement | Handle-lifecycle and exactly-once requirements | Codex implementation assistant | native diagnostics and 25-cycle soak |
52
+ | 2026-07-12 | Verify ABI, hash, platform, architecture, and Ed25519 trust before load | FR-038 | Codex implementation assistant | `xeno-pty-loader.ts`, manifest signer |
53
+ | 2026-07-12 | Forbid `node-pty` and `node-addon-api` reintroduction | Phase 3 dependency gate | Codex implementation assistant | ownership policy revision 5 |
54
+ | 2026-07-12 | Resolve Windows N-API exports from the actual host process instead of importing `node.exe` | renamed/self-contained Node hosts must load the same owned addon safely | Codex implementation assistant | `xeno_pty_win.cpp`, PE import verifier, packaged Windows doctor smoke |
55
+ | 2026-07-12 | Standardize release Windows builds on MSVC and reject non-platform PE imports | exclude GNU runtime linkage and undeclared auxiliary DLLs | Codex implementation assistant | `build-windows.ps1`, `verify-pe-imports.mjs` |
56
+
57
+ ## AI assistance
58
+
59
+ - Models/tools used: OpenAI Codex coding agent, local PowerShell, Microsoft C/C++ 19.44, Node.js, Vitest, and an isolated Debian Docker verifier.
60
+ - Prompt or retained prompt-summary path: active Xeno proprietary migration goal and `switch-to-proprietary.md`.
61
+ - Confirmation that no third-party source entered the prompt: no replaced-package implementation source was supplied or inspected; public platform/API documentation and Xeno-owned contracts were used.
62
+ - Human review performed: pending.
63
+
64
+ ## Verification evidence
65
+
66
+ - Unit and compatibility tests: 13 focused tests pass on Windows; 12 execute and pass in a clean Linux Docker dependency environment with one Windows-only local-load assertion skipped.
67
+ - Conformance corpus: TTY startup, ordered output, Unicode input/output, resize protocol, foreground-to-background PID preservation, Ctrl+C delivery, exactly-once exit, graceful-to-force escalation, early-output bound, descendant cleanup, tampered hash rejection, unsigned-install rejection.
68
+ - Fuzz campaign and duration: deterministic malformed-input and lifecycle/state campaigns pass 100 iterations on the current Windows x64 artifact in 10.064 seconds, 100 iterations on Linux x64, 100 iterations on Linux arm64 under emulation, and 250 Linux x64 iterations under AddressSanitizer and UndefinedBehaviorSanitizer. Coverage-guided native fuzzing remains required before capability approval.
69
+ - Security/resource-limit tests: finite native event queue, bounded early buffer, hash mismatch rejection, malformed manifest rejection, installed unsigned artifact rejection, and isolated Linux AddressSanitizer/UndefinedBehaviorSanitizer smoke plus stress execution.
70
+ - Cross-platform results: Windows x64, Linux x64, and Linux arm64 local/container pass; Windows arm64 and macOS x64/arm64 matrix runs pending.
71
+ - Performance comparison: 25 rapid real-PTY cycles pass with native active-state count returning to zero. The current Windows MSVC artifact measures startup p50/p95 35.31/359.15 ms and approximately 2.6 MB/s observed output; the Linux x64 baseline measures p50/p95 14.76/17.55 ms and approximately 32.6 MB/s. Linux arm64 under emulation measures p50/p95 556.17/612.07 ms and approximately 1.64 MB/s. The dependency-free benchmark enforces conservative CI limits of 2,000 ms p95 and 1 MiB/s; a product-approved comparative release envelope remains pending.
72
+ - Bundle/native/SBOM evidence: artifact audit records Xeno-owned Windows x64 SHA-256 `91d9a464823091603d784cbc3a570b8a0e514576eeb4b8fb2aabcdcbb64bccad` from source SHA-256 `9f6f6248f35f2f6b767b153f66670d5ed8f95cb7d6242c77c652efe5cca2d038`, Linux x64 SHA-256 `a93757b552cb9236fe33773228072df270659d6a015a92fb96d21a9d22c5f2cb`, and Linux arm64 SHA-256 `07f660ac0c32ac7a2900f3abdfa12550f603880f02a1763a12a63064fe802006`; both Linux artifacts derive from source SHA-256 `6ba69e62cf0c0765546afa19f1820c1cc7f64f452802718c20b4a117d6c8f9c6`. The Windows PE imports only `KERNEL32.dll`; two local native rebuilds are byte-identical. Clean Debian candidates execute Linux x64 and Linux arm64 self-contained payloads. The exact cross-built Windows x64 payload (`21386d53c04116f4904da186c873089aac4db57c02281da2c14f615a50a9b616`) executes on Windows with a byte-matching extracted addon and healthy ConPTY diagnostics. The Linux arm64 payload SHA-256 is `92a8583433aec8415c1405b56ad5afe39f7560c216eac4e46684fb03041e6346`. Paired release verification correctly stops at the strict unsigned-native gate; see `docs/compliance/linux-package-candidate.md` and `docs/compliance/linux-arm64-package-candidate.md`. Clean signed-install smoke remains pending.
73
+
74
+ ## Open legal or provenance questions
75
+
76
+ - Patents/specification terms: operating-system and Node API boundary review pending.
77
+ - Trademarks: historical replaced-package names remain only in migration evidence and forbidden-package rules.
78
+ - Export or distribution constraints: native binary distribution and signing review pending.
79
+ - Other: release trust store is empty and both exercised prebuilds are intentionally marked `unsigned-development`; unobserved architecture CI, coverage-guided fuzzing, independent review, contributor disclosures, and counsel disposition remain mandatory.
80
+
81
+ ## Handoff
82
+
83
+ - Implementation complete: Windows x64, Linux x64, and Linux arm64 yes; complete PTY milestone no
84
+ - Evidence complete: no
85
+ - Ready for independent provenance review: after signing, coverage-guided fuzzing, and remaining cross-platform package evidence
86
+ - Author/date: Codex implementation assistant, 2026-07-12