Emit VISOR artifact bundle#466
Conversation
|
Warning Review limit reached
Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 586c217774
ℹ️ 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".
| fixtureId: input.fixtureId, | ||
| deterministicSeed: input.deterministicSeed, | ||
| consumedHashes: { | ||
| sourceHash: input.normalizedSourceHash, |
There was a problem hiding this comment.
Record the raw source hash in replay metadata
When the raw SDL text differs from its normalized semantic form, this stores replay.consumedHashes.sourceHash as the normalized hash instead of the raw sourceHash already computed for the bundle. That makes the replay metadata unable to prove the exact source text it consumed, and it leaves sourceHash indistinguishable from normalizedSourceHash even though the bundle contract exposes both raw and semantic source identities.
Useful? React with 👍 / 👎.
| export function createVisorArtifactBundle(input: CreateVisorArtifactBundleInput): VisorArtifactBundle { | ||
| const fixtureId = normalizeLogicalId(input.fixtureId, 'fixtureId'); | ||
| const scenarioId = normalizeLogicalId(input.scenarioId ?? `${fixtureId}:graphql-to-ui-scene`, 'scenarioId'); | ||
| const deterministicSeed = input.deterministicSeed ?? 'no-randomness'; |
There was a problem hiding this comment.
Validate deterministicSeed before replaying it
When callers provide deterministicSeed, this value is copied into replay metadata without the logical-id or host-local checks used for fixture/scenario ids. Passing a seed such as /tmp/run-123 or pid:... emits the absolute-path or process-local replay facts the bundle contract says must be rejected, so VISOR artifacts can become non-portable while still passing the builder.
Useful? React with 👍 / 👎.
| assertDebugSummaryMatchesFacts(input.bijouBlock, input.uiScene, input.debugSummary); | ||
|
|
||
| const sourceHash = hashUiSceneValue(input.sourceText); | ||
| const normalizedSourceHash = input.bijouBlock.sourceHash; |
There was a problem hiding this comment.
Validate the artifact source hash before trusting it
For direct createVisorArtifactBundle() callers, this trusts bijouBlock.sourceHash as the normalized source identity without checking that it matches the artifact body. If a prepared artifact has that field changed and the scene/debug summary are generated from that same artifact, the existing scene and debug hash checks still pass, but the bundle advertises a normalized source hash that no longer identifies the normalized bijou-block/1 facts.
Useful? React with 👍 / 👎.
| assertSceneMatchesArtifact(input.bijouBlock, input.uiScene); | ||
| assertDebugSummaryMatchesFacts(input.bijouBlock, input.uiScene, input.debugSummary); | ||
|
|
||
| const sourceHash = hashUiSceneValue(input.sourceText); |
There was a problem hiding this comment.
Reject source text that does not compile to the artifact
For direct createVisorArtifactBundle() callers, sourceText is only hashed and embedded; it is never parsed or compared with the supplied bijouBlock. A caller can therefore pass malformed or unrelated SDL alongside a valid artifact/scene/debug summary and still get a bundle whose raw source does not produce the advertised normalized artifact, breaking the source-to-scene proof chain.
Useful? React with 👍 / 👎.
Summary
visor-artifact-bundle/1proof surface for VISOR: emit GraphQL block artifact bundle with replay and visual scene facts #458 throughcreateVisorArtifactBundleFromGraphql()andcreateVisorArtifactBundle().bijou-block/1,ui-scene-ir/1,graphql-bijou-block-debug/1, replay metadata, visual scene facts, receipt hashes, raw source identity, and semantic bundle identity.Linked Work
Closes #458.
Refs #457.
Refs flyingrobots/visor#1.
Design:
docs/design/DX-049-visor-artifact-bundle-proof.mdValidation
npx vitest run --config vitest.config.ts tests/cycles/DX-049npx vitest run --config vitest.config.ts tests/cycles/DX-049 tests/cycles/DX-046/graphql-dogfood-navigation-fixture.part01.test.ts tests/cycles/DX-046/graphql-dogfood-navigation-fixture.part02.test.ts packages/bijou/src/core/graphql-bijou-block.part01.test.ts packages/bijou/src/core/graphql-bijou-block.part02.test.ts packages/bijou/src/core/graphql-bijou-block.part03.test.ts packages/bijou/src/core/graphql-bijou-block.part04.test.tsnpx markdownlint-cli2 docs/design/DX-049-visor-artifact-bundle-proof.mdnpm run docs:inventorynpm run typecheck:testnpm run code-dojo:changednpm run lintnpm run code-dojo:precommitgit diff --check