Skip to content

test(stack): add Stack Witness 0001 fixture artifact shape - #499

Merged
flyingrobots merged 2 commits into
mainfrom
wip/stack-witness-0001
May 11, 2026
Merged

flyingrobots merged 2 commits into
mainfrom
wip/stack-witness-0001

Conversation

@flyingrobots

@flyingrobots flyingrobots commented May 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds the Stack Witness 0001 fixture artifact shape for the jedit-through-Echo walking skeleton.

This PR publishes a hermetic Wesley fixture that Echo can mirror without making Wesley depend on Echo runtime internals.

Why

Echo now has a tiny jedit-through-Echo walking skeleton. Wesley needs to publish the corresponding fixture artifact shape so the stack can detect drift before real generated integration begins.

The specific boundary being proven is:

createBuffer
-> replaceRange("hello")
-> textWindow(0..5)
-> ReadingEnvelope + QueryBytes

The fixture is intentionally narrow. It does not redesign Wesley, generalize contract hosting, touch Continuum, or publish a new Wesley release.

Changes

  • Added test/fixtures/consumer-models/stack-witness-0001-file-history.graphql with the Stack Witness 0001 GraphQL operation surface.
  • Added test/fixtures/consumer-models/stack-witness-0001-vectors.json with operation ids, canonical vars encoding, helper shape, declared footprints, and expected query payload bytes.
  • Hardened canonical vars for replaceRange and textWindow so target buffer identity is part of operation meaning.
  • Modeled QueryBytes with base64-shaped byte payload semantics instead of pretending arbitrary bytes are plain text.
  • Added Wesley core fixture-vector validation for SDL/vector drift, artifact identity, op-id consistency, footprint coverage, helper shape fields, and expected payload bytes.
  • Added Rust and TypeScript emitter coverage that checks operation-local metadata blocks instead of broad global substrings.
  • Documented consumer-models/ fixture ownership in test/fixtures/README.md.
  • Added an Unreleased changelog entry.

Evidence

Claim Evidence
Fixture schema defines buffer-targeted mutation/read inputs and byte-safe query payload slots. test/fixtures/consumer-models/stack-witness-0001-file-history.graphql: lines 48-75
createBuffer, replaceRange, and textWindow publish artifact identity, op ids, helper kind, canonical vars encoding, canonical vars bytes, fixture-vector anchors, and footprints. test/fixtures/consumer-models/stack-witness-0001-file-history.graphql: lines 78-173
Vector fixture carries operation ids, canonical vars, declared footprints, helper shapes, and expected hello query bytes as hex. test/fixtures/consumer-models/stack-witness-0001-vectors.json: lines 1-87
Wesley core validates the fixture operation catalog and SDL/vector drift lock. crates/wesley-core/tests/operation_analysis.rs: lines 305-519
Rust operation emission keeps Stack Witness metadata attached to the correct generated operation blocks. crates/wesley-emit-rust/src/lib.rs: lines 738-789
TypeScript operation emission keeps Stack Witness metadata attached to the correct generated operation blocks. crates/wesley-emit-typescript/src/lib.rs: lines 755-809

Risk

Low runtime risk. This PR adds fixture data, tests, docs, and changelog coverage only.

Main integration risk is fixture drift between Wesley and Echo. That is intentional: Echo now mirrors this vector and has a separate drift-lock regression. If this Wesley vector changes, Echo must update its mirror in the dependent PR.

No Wesley release is included. Publishing should wait for reuse pressure after the seam lands.

Backout

Revert this PR. It only adds fixture artifacts and tests; reverting removes the Stack Witness 0001 fixture surface without touching released Wesley runtime behavior.

If Echo has already landed its mirror, revert or update the Echo drift-lock PR/commit at the same time so Echo does not point at a removed Wesley fixture.

Testing

cargo test -p wesley-core lists_stack_witness_0001_fixture_artifact_shape
cargo test -p wesley-emit-rust emits_stack_witness_0001_fixture_operation_bindings
cargo test -p wesley-emit-typescript emits_stack_witness_0001_fixture_operation_bindings

Additional push-time validation:

Repo Bats smoke suite passed

CI on PR head 1b8cdaa2de57031fe91c29d8820f8c4f04885d7e is green.

Checklist

  • Stack Witness 0001 fixture schema added.
  • Stack Witness 0001 fixture vectors added.
  • Operation ids recorded for createBuffer, replaceRange, and textWindow.
  • Canonical vars include target buffer identity where operation meaning requires it.
  • Declared footprints are covered by regression tests.
  • EINT helper shape is covered by regression tests.
  • QueryView helper shape and expected query bytes are covered by regression tests.
  • Rust operation binding emission is covered.
  • TypeScript operation binding emission is covered.
  • Docs/changelog updated.
  • No Continuum changes.
  • No Wesley release/publish step.

@coderabbitai

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR introduces comprehensive test fixtures for the Stack Witness 0001 "file history" consumer model. It adds a GraphQL schema defining three operations (createBuffer, replaceRange, textWindow) with Wesley metadata directives, corresponding operation metadata in JSON, and validates the fixture across schema analysis, Rust code generation, and TypeScript code generation tests.

Changes

Stack Witness 0001 Test Fixture and Validation

Layer / File(s) Summary
GraphQL Schema Definition
test/fixtures/consumer-models/stack-witness-0001-file-history.graphql
Defines the file history schema with TextCoordinateSystem, Buffer, MutationReceipt, TextAperture, ReadingEnvelope, QueryBytes, and TextWindowReading types. Introduces input types (CreateBufferInput, ReplaceRangeInput, TextWindowInput) and operations (createBuffer, replaceRange, textWindow) annotated with @wes_op, @wes_artifact, @wes_stack_witness, and @wes_footprint directives.
Operation Vectors Fixture
test/fixtures/consumer-models/stack-witness-0001-vectors.json
Provides canonical variable encodings and metadata for three operations: createBuffer (EINT helper, creates Buffer), replaceRange (reads/writes Buffer, creates Tick and Receipt), and textWindow (QueryView helper, reads Buffer/Tick/Receipt). Each operation includes opId, helper kind, canonical vars bytes, declared footprints, and helper shape details.
Schema Operation Analysis Test
crates/wesley-core/tests/operation_analysis.rs
Loads the GraphQL schema and vectors fixture, asserts the fixture contains exactly 3 operations, and validates operation/argument/result types and directive fields for each operation using a vector_for helper to retrieve matching vector entries by operation name.
Rust Code Generation Test
crates/wesley-emit-rust/src/lib.rs
Generates Rust operation bindings from the fixture schema, validates the presence of request/response binding structs and type aliases, confirms DIRECTIVES_JSON includes serialized directive metadata (artifact, opId, helperKind, canonicalVarsBytes, payloadCodec, envelope), and verifies the output parses as valid Rust.
TypeScript Code Generation Test
crates/wesley-emit-typescript/src/lib.rs
Generates TypeScript operation bindings from the fixture schema, asserts the output contains expected operation request/response interfaces, operation binding exports, and specific directive/metadata JSON fragments with opId and helperKind values.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 With fixtures fresh and tests now abound,
Stack Witness 0001 claims hallowed ground,
Three operations dance with directives so bright,
Schema and vectors aligned just right,
From Rust to TypeScript, the code flows true—
A consumer model born anew! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a Stack Witness 0001 fixture artifact shape test.
Docstring Coverage ✅ Passed Docstring coverage is 90.91% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed PR description is comprehensive and well-structured, following the template with all major sections present including Summary, Why, Changes, Risk, Backout, Testing, Evidence, and Checklist.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wip/stack-witness-0001

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 11, 2026 •

Copy link
Copy Markdown

🔍 The Case of Pull Request #499

Plain-English Readout

  • Holmes (evidence investigation): Holmes says this change should not ship in its current state. Main reasons: No evidence citations were available for trust analysis; test evidence is incomplete; schema coverage is incomplete.
  • Watson (independent verification): Watson found verification concerns. Most important concern: Low migration risk claimed but schema incomplete.
  • Moriarty (trend forecast): Moriarty sees progress as stalled right now, so forecast confidence is limited.

Suggested next actions

  1. Tighten citations so the report points to exact lines instead of whole files or coarse references.
  2. Resolve Watson’s verification concerns before trusting the Holmes verdict as final.
  3. Treat the readiness forecast as stalled until new evidence or real progress moves the trend again.
  4. Add or strengthen tests for the schema elements and operations HOLMES flagged as weakly proven.
📚 Glossary (what the Holmes terms mean)
  • HOLMES: Wesley’s main evidence investigation. It decides whether the cited proof is strong enough to justify shipping this commit.
  • WATSON: An independent verification pass. It checks Holmes’s citations and score math instead of trusting them blindly.
  • MORIARTY: A readiness forecast over time. It is advisory trend analysis, not the release gate itself.
  • Schema coverage score (SCS): How much of the schema has direct supporting evidence across generated artifacts and cited proof.
  • Test confidence index (TCI): How much test evidence exists for constraints, policies, relationships, and operations.
  • Migration risk index (MRI): How risky the schema change is to roll out. Lower is better.
  • Evidence trust: Whether the report is backed by exact citations, whole-file citations, or coarse references. Weak trust means the claim may be directionally right but not specific enough to trust blindly.
  • Citation quality: A count of exact line-span citations versus whole-file or coarse references.
  • ELEMENTARY: Ready to ship based on the current evidence.
  • REQUIRES INVESTIGATION: More work or review is needed before shipping.
  • YOU SHALL NOT PASS: Do not ship this change in its current state.

🕵️ SHA-lock HOLMES full report (click to expand)

🕵️ SHA-lock HOLMES Investigation

  • Generated: 2026-05-11T16:30:28.377Z
  • Commit SHA: bb38252
  • Bundle Version: 2.0.0

⚠️ Evidence valid only for commit bb38252

🔍 Executive Deduction

"Watson, after careful examination of the evidence, I deduce..."

Weighted Completion: ░░░░░░░░░░ 0.0%
Scores: SCS 0.0% · TCI 0.0% · MRI 0.0%
Verification Status: 0 claims verified
Citation Quality: 0 exact · 0 whole-file · 0 coarse
Evidence Trust: missing
Ship Verdict: YOU SHALL NOT PASS

🧩 SCS Breakdown

Component Score Coverage
Sql 0.0% 0.00/154.00
Types 0.0% 0.00/154.00
Validation 0.0% 0.00/154.00
Tests 0.0% 0.00/154.00

🧪 TCI Breakdown

Component Score Coverage Note
Unit Constraints 0.0% 0/104 N/A
Unit Rls 0.0% — N/A
Integration Relations 0.0% 0/3 N/A
E2e Ops N/A — Query operation test tracking not yet implemented

⚠️ MRI Breakdown

Component Risk Share Points Count
Drops 0% 0 0
Renames Without Uid 0% 0 0
Add Not Null Without Default 0% 0 0
Non Concurrent Indexes 0% 0 0

📊 The Weight of Evidence

"Observe, Watson, how not all features carry equal importance..."

Element Weight Status Evidence Strength Deduction

🚪 Security & Performance Gates

"Elementary security measures, Watson..."

Gate Status Evidence Holmes's Ruling
Migration Risk ✅ MRI: 0.0% "Trivial risk"
Test Coverage ⚠️ TCI: 0.0% "Theatrical tests!"
Sensitive Fields ✅ 0 fields "All secured"
Evidence Quality ⛔ 0 exact · 0 whole-file · 0 coarse "No evidence citations were available for trust analysis."

📋 The Verdict

⛔ YOU SHALL NOT PASS
"Critical evidence is missing! Return to your laboratory!"

Signed and sealed,

  • S. Holmes, Consulting Detective

[END OF INVESTIGATION FOR COMMIT bb38252]

🧵 Command Run

  • Run ID: run-mp1f53w9-n9ofvu
  • Transmutation: holmes-investigate
  • Command: investigate
  • Status: completed
  • Ledger: /home/runner/work/wesley/wesley/test/fixtures/examples/.wesley-cache/ledger

🩺 Dr. WATSON full report (click to expand)

🩺 Dr. Watson's Independent Verification Report

Medical Examination of Evidence

  • Examination Date: 2026-05-11T16:31:37.467Z
  • Patient SHA: bb38252

🔬 Citation Verification

"Let me examine each piece of evidence independently..."

  • Citations Examined: 0
  • Verified: 0 ✅
  • Failed: 0 ❌
  • Unable to Verify: 0
  • Exact Subrange Citations: 0
  • Whole-file Citations: 0
  • Coarse Citations: 0
  • Evidence Trust: missing
  • Trust Note: No evidence citations were available for trust analysis.

Verification Rate: 0.0%

📊 Mathematical Verification

"I shall recalculate Holmes's arithmetic..."

Holmes claimed SCS: 0.0%
Watson calculates: 0.0%
Difference: ✅ Negligible

🔍 Consistency Analysis

"Checking for contradictions in Holmes's deductions..."

⚠️ Low migration risk claimed but schema incomplete

🩺 Dr. Watson's Medical Opinion

VERIFICATION: CONCERNS NOTED ⚠️

"While Holmes's methods are generally sound, I have noted some"
"discrepancies that warrant further investigation. No evidence citations were available for trust analysis."

Respectfully submitted,

  • Dr. J. Watson, M.D.
    Medical Examiner & Verification Specialist

🧵 Command Run

  • Run ID: run-mp1f5r74-weiagv
  • Transmutation: watson-verify
  • Command: verify
  • Status: completed
  • Ledger: /home/runner/work/wesley/wesley/test/fixtures/examples/.wesley-cache/ledger

🔮 Professor MORIARTY full report (click to expand)

🧠 Professor Moriarty's Temporal Predictions

The Mathematics of Inevitability

  • Analysis Date: 2026-05-11T16:32:29.617Z

🔮 Current State

SCS: ░░░░░░░░░░ 0.0%
TCI: ░░░░░░░░░░ 0.0%
MRI: 0.0% risk
Evidence Trust: missing

📈 Velocity Analysis

SCS Velocity: +0.00%/day
Git Activity (window): 24h · commits 2 (2 relevant) · ~2.00 commits/day
↳ Magnitude: ~179 relevant LOC/day across ~1.0 files/day
Activity Index: 15 / 100 (PR 0, Window 39)
Blended Velocity: +0.09%/day
Commit Size Burstiness: 66 / 100 (higher = more uneven commit sizes)
⚠️ PLATEAU DETECTED - Low SCS movement and low recent Git activity.

⏰ Completion Predictions

ETA: Cannot predict (insufficient velocity)

"At current velocity, completion is... improbable."

⚠️ Warnings

  • Evidence trust is missing; No evidence citations were available for trust analysis.

🧪 Readiness EXPLAIN

  • SCS ≥ 80% → FAIL ❌ (actual 0.0%)
  • TCI ≥ 70% → FAIL ❌ (actual 0.0%)
  • MRI ≤ 40% → PASS ✅ (actual 0.0%)
  • CI Stability ≥ 90% (branch main) → PASS ✅ (actual 93% over ~168h)
  • Evidence Trust ≥ moderate → FAIL ❌ (actual missing) — No evidence citations were available for trust analysis.
  • Delivery context (last 168h): 0 issues closed · 3 PRs merged (informational, not gating)

Signals blend: SCS velocity (70%) + Git activity (30%, branch-first). Activity only suppresses false plateaus; it never inflates readiness.

📊 Historical Trajectory

05-11: ░░░░░░░░░░ 0.0%
05-11: ░░░░░░░░░░ 0.0%
05-11: ░░░░░░░░░░ 0.0%

"Every problem becomes elementary when reduced to mathematics"
— Professor Moriarty

🧵 Command Run

  • Run ID: run-mp1f6vfz-zksj1x
  • Transmutation: moriarty-predict
  • Command: predict
  • Status: completed
  • Ledger: /home/runner/work/wesley/wesley/test/fixtures/examples/.wesley-cache/ledger

Machine-readable reports: holmes-report.json · watson-report.json · moriarty-report.json (see workflow artifacts).


Filed at 221B Repository Street

@flyingrobots

Copy link
Copy Markdown
Owner Author
Issue Severity Addressed by Regression coverage Outcome
PR description was missing required template sections: Why, Changes, Risk, Backout, Testing, and Checklist. Docs PR body update on head 1b8cdaa PR body required-section check; gh pr view 499 --json body --jq .body with heading assertions Pass: required sections present and evidence citations added.
HOLMES/WATSON feedback reported missing evidence citations and incomplete test/schema coverage for the Stack Witness fixture. P2 1b8cdaa lists_stack_witness_0001_fixture_artifact_shape; cargo test -p wesley-core lists_stack_witness_0001_fixture_artifact_shape Pass: SDL/vector drift lock, artifact identity, op-id consistency, footprints, helper shapes, and expected payload bytes are asserted.
Rust/TypeScript generated operation metadata needed stronger evidence that Stack Witness metadata stays attached to the correct operation blocks. P3 1b8cdaa emits_stack_witness_0001_fixture_operation_bindings; cargo test -p wesley-emit-rust emits_stack_witness_0001_fixture_operation_bindings && cargo test -p wesley-emit-typescript emits_stack_witness_0001_fixture_operation_bindings Pass: generated Rust and TypeScript operation-local metadata checks are green.

@flyingrobots
flyingrobots merged commit 79fac72 into main May 11, 2026
23 checks passed
@flyingrobots
flyingrobots deleted the wip/stack-witness-0001 branch May 11, 2026 16:44
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