Skip to content

Fix ledger append finalization and notes projections - #65928

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-ledger-projection-smoke-failures
Oct 5, 2026
Merged

pelikhan merged 3 commits into
mainfrom
copilot/fix-ledger-projection-smoke-failures

Conversation

Copilot AI commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Ledger smoke runs failed when safe-output validation rejected the ledger_append message envelope, preventing transaction artifacts from being written. The notes projection also exposed note_state as a view rather than a table.

  • Ledger persistence: Strip the transport type discriminator before validating append fields, allowing the transaction artifact to be finalized and pushed.
  • Notes projection: Materialize note_state with vote totals and timestamps as a replay table, including when the ledger is empty.
  • Work-queue smoke: The current workflow manifest advertises work_queue_read and work_queue_claim_finish.

For example, a safe-output message like {"type":"ledger_append","ledger":"events","operation":"append","value":{}} is normalized before validation.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ledger projection and work queue smoke test failures Fix ledger append finalization and notes projections Oct 5, 2026
Copilot AI requested a review from pelikhan October 5, 2026 20:04
@pelikhan
pelikhan marked this pull request as ready for review October 5, 2026 20:11
Copilot AI balanced review requested due to automatic review settings October 5, 2026 20:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.

Copilot review overview

Review effort: Lite
Findings: 1 Medium severity · 3 Low severity

Open (4)
What changed in this PR

This PR updates the notes ledger replay to materialize note_state as a physical table (instead of an SQLite view) and hardens ledger append ingestion by normalizing/removing a safe-output type discriminator before validation.

Changes:

  • Replace note_state SQLite view generation with replay-time note_state table generation in the builtin notes reducer.
  • Simplify projection creation by removing post-processing that created the note_state view and metadata entry.
  • Normalize ledger append envelopes by stripping/validating the top-level type field before queueing requests; add tests for the behavior.
File Description
actions/​setup/​js/​ledger_builtin.cjs Removes NOTE_STATE_VIEW and computes/materializes note_state as a replay table.
actions/​setup/​js/​create_ledger_projection.cjs Drops special-case view creation; relies on replay output tables.
actions/​setup/​js/​ledger_append.cjs Validates append envelope shape and strips safe-output type discriminator.
actions/​setup/​js/​ledger_builtin.test.cjs Updates notes replay test to rely on table materialization (no manual view exec).
actions/​setup/​js/​ledger_append.test.cjs Adds test ensuring safe-output type is normalized before validation.
actions/​setup/​js/​create_ledger_projection.test.cjs Asserts note_state is a table and that empty projections materialize empty tables.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread actions/setup/js/ledger_builtin.cjs Outdated
Comment thread actions/setup/js/ledger_append.cjs Outdated
Comment thread actions/setup/js/ledger_builtin.cjs Outdated
Comment thread actions/setup/js/ledger_builtin.cjs Outdated
Reject unexpected votes during aggregation, share the empty vote-state factory, and report append envelope kinds without exposing payloads. Add regression coverage for both validation paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan merged commit 10db0fe into main Oct 5, 2026
11 of 12 checks passed
@pelikhan
pelikhan deleted the copilot/fix-ledger-projection-smoke-failures branch October 5, 2026 21:29
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.91.0

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.

[AW Top 10] 08 Fix ledger projection and work queue smoke failures

3 participants