Implement ETQ-303 v3 exact event protocol - #12
Conversation
Reviewer's GuideImplements the ETQ-303 v3 exact 303-state tensor event protocol on top of the preserved ETQ-101 v2 model, adds canonical event/graph constructions and deterministic receiver artifacts, and wires in contracts, schemas, receipts, and verification/build scripts while renaming the package to @qsol-imc/etq-303 v3.0.0. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Sorry @EmergentMonk, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a54e2a92a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| gitCommit: "8c24d58ca76abbac77c427a4f63ca434570c82b3", | ||
| versionDoi: "10.5281/zenodo.21432511", | ||
| basisSha256: "97cfd1f087745422fd66d3640c7b86c3209593c4b53741018c08a5e9cdb15f6f", | ||
| adjacencySha256: "29ae0af5b1090c9de30f1efc25789060fb1791eb175d2afcd6888847f7fe6324", |
There was a problem hiding this comment.
Regenerate the committed contract with the current lineage hash
npm run verify fails before the v2/legacy verifiers because buildCanonicalContract() emits this adjacency hash (...8887f7fe6324), while examples/etq-303.v3.canonical.json contains ...8847f7fe6324. The committed contract/schema fixtures need regeneration (or the lineage value corrected if the fixture is authoritative) so the required root verification entrypoint can pass.
Useful? React with 👍 / 👎.
| receiverId: "ndjson-stream-v1", | ||
| filename: "events.ndjson", | ||
| mediaType: "application/x-ndjson", | ||
| bytes: utf8(buildNdjsonReceiver(eventDocument)), | ||
| semantics: "one-lossless-enriched-event-per-line", |
There was a problem hiding this comment.
Restrict generated receivers to allowed root artifact types
The root AGENTS.md permits persisted ETQ runtime/export artifacts only as .mid, .csv, or .json. npm run build:v3 passes these receiver artifacts to its file-writing loop, so this entry persists events.ndjson (and the adjacent GraphML/SVG receivers persist additional disallowed extensions), violating the root output policy rather than merely keeping development files in the repository.
Useful? React with 👍 / 👎.
| const output = outputArgument(); | ||
| rmSync(output, { recursive: true, force: true }); | ||
| mkdirSync(output, { recursive: true }); |
There was a problem hiding this comment.
Prevent recursive deletion of arbitrary output paths
When a caller supplies --output . (or any path containing valuable files), resolve() accepts it and this unconditional rmSync(..., recursive: true) deletes that entire directory before generation. Since the CLI exposes --output without a confinement or safety check, a common attempt to generate artifacts in the current directory can erase the worktree; reject unsafe targets or require an empty dedicated output directory.
Useful? React with 👍 / 👎.
| gaussianPhaseExponents: [...FIBRE_PHASE_GAUSSIAN_EXPONENTS], | ||
| gaussianPhaseSymbols: [...GAUSSIAN_UNIT_SYMBOLS], |
There was a problem hiding this comment.
Align phase-symbol values with the phase exponents
For the declared stencil, gaussianPhaseExponents is [3,2,3], whose corresponding symbols are [-i,-1,-i]; this field instead publishes the four-value lookup table [1,i,-1,-i]. Consumers reading the canonical contract as the declared phase mapping therefore receive an array with the wrong length and incorrect first two labels, despite each emitted event having the correct per-transition symbol.
Useful? React with 👍 / 👎.
| const receiptCore = { | ||
| schema: RECEIPT_SCHEMA_ID, | ||
| modelId: MODEL_ID, | ||
| modelVersion: MODEL_VERSION, | ||
| profile: PROFILE_ID, |
There was a problem hiding this comment.
Record the v3 implementation identity in provenance
The generated receipt identifies only MODEL_ID/MODEL_VERSION and hashes the generated bytes; its manifest lineage likewise contains only the v2 base release. The root AGENTS.md requires changed ETQ export workflows to record their implementation identity in JSON provenance, so two different v3 source revisions that retain 3.0.0 cannot be traced from these receipts to the code that produced the artifacts. Include a pinned v3 source revision or implementation hash in the contract/receipt/manifest identity chain.
Useful? React with 👍 / 👎.
| buildSvgReceiver, | ||
| } from "./etq-v3-receivers.mjs"; | ||
|
|
||
| export const CONTRACT_SCHEMA_PATH = "../spec/etq-303.v3.schema.json"; |
There was a problem hiding this comment.
Use a schema reference valid in the generated artifact bundle
The build writes contract.json and contract.schema.json into the same output directory, but the contract's $schema remains ../spec/etq-303.v3.schema.json. For a default or custom npm run build:v3 bundle, that relative path resolves to a nonexistent dist/spec/... (or sibling custom-output spec/...) file, so schema-aware consumers cannot validate the emitted contract without external repository layout knowledge. Point the generated contract at the bundled schema or an absolute stable schema URL.
Useful? React with 👍 / 👎.
|
Implemented the six Codex review fixes and regenerated the deterministic fixtures.
Regression tests now cover all six cases. The final GitHub Actions run passed, including both |
Summary
Implements ETQ-303 v3.0.0 as an exact, receiver-neutral event protocol over the preserved ETQ-101 v2 selected-root basis.
Exact model
H_303 = H_101 tensor C^3extension into a named v3 protocol without claiming 303 distinct E8 roots.[3,2,3]with their actual Gaussian-unit symbols[-i,-1,-i], while keeping[1,i,-1,-i]as the separate lookup table.G_303 = G_101 square C_3: 303 vertices, 5,364 edges, degree range 24–57, and one connected component.Receiver-neutral artifacts
The canonical commitment is
events.json. The root build emits only policy-allowed artifacts:events.jsonevents.csvgraph.jsonevent-atlas.jsonevents.midGraphML, SVG, and NDJSON conversion are left to external or separately scoped receiver tools rather than the root ETQ export path.
Reproducibility and safety
./contract.schema.jsoninside generated bundles while retaining the repository-relative schema reference for the committed fixture;$schemaremains outside the semantic payload hash.dist/, and files are created exclusively.Validation
npm test npm run verify npm run build:v3The v3 suite covers the preserved v2 hashes, tensor/CRT bijections, exact operator order, phase-symbol alignment, Cartesian graph lift, artifact-extension allowlist, implementation provenance, portable bundled schema, output-path safety, and the acyclic receipt chain.
Review fixes
This branch addresses the six Codex review findings: fixture regeneration, root artifact allowlisting, unsafe recursive deletion, phase-symbol alignment, v3 implementation identity, and bundle-local schema resolution.