Skip to content

fix(project): report a corrupt authority ledger - #916

Closed
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
synthetic-sciences:mainfrom
aniruddhaadak80:o1-pr3-authority-ledger
Closed

ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
synthetic-sciences:mainfrom
aniruddhaadak80:o1-pr3-authority-ledger

Conversation

@aniruddhaadak80

Copy link
Copy Markdown
Contributor

What does this PR do, and why?

read() called JSON.parse(text) BEFORE the corruption check two lines below it, so a truncated or hand-edited authority-processes.json threw a bare SyntaxError instead of the file's own message telling the operator the ledger is corrupt and process revocation is being refused.

Linked issue

small fix, no issue

How did you verify it?

cd backend/cli && bun test test/project/authority-process-corrupt-ledger.test.ts

Regression proof: the truncated-ledger test fails at base with the raw JSON parse error; the structurally-invalid case passes both before and after, proving the change targets only the parse and leaves the existing shape guard alone.

cd backend/cli && bun test test/project/authority-process-corrupt-ledger.test.ts -> 3 pass / 0 fail. The pre-existing authority-process-ledger suite re-runs at 4 pass / 1 skip (Darwin-only) / 0 fail.

This does not weaken the fail-closed posture: a corrupt ledger still refuses revocation, it now just says so legibly. The duplicated literal was collapsed into corrupt(), so the shape-validation throw is textually identical to before.

Not verified: complete() and assertRelocationSafe() also route through read() and so inherit the fix, but only revoke() is directly exercised by the new test.

Two pre-existing conditions in this checkout, reproduced on the untouched base commit and therefore not caused by this change: �un run typecheck (turbo) fails with sgo: command not found, and �un run format:check reports roughly 30 files. I ran sc --noEmit for �ackend/cli and prettier on the files I touched instead; neither appears in the base warning list.

Checklist

  • �un run check is green (format, typecheck, backend + frontend/ui + SDK tests)
  • �un run --cwd frontend/workspace build succeeds if I touched rontend/workspace or rontend/ui (not applicable - no frontend/workspace or frontend/ui file changed)
  • ./tooling/repo/generate.ts was run and the ooling/sdk output committed if I changed �ackend/cli/src/server (not applicable - no �ackend/cli/src/server file changed)
  • [[x]] CHANGELOG.md has an Unreleased entry if the change is user-visible
  • The matching docs page under rontend/docs/src/content/openscience/ is updated if behavior changed (not applicable - no documented behavior changed)
  • Screenshots or a short video are attached for UI changes (not applicable - no UI change)
  • No version bumps (package.json versions and tags are written by the release workflow)
  • install and rontend/landing/public/install are still byte-identical if I touched either (not applicable - neither was touched)

I left the first box unticked rather than claiming it: �un run check cannot pass in this checkout because turbo cannot find sgo, and that failure reproduces on the base commit.

Copilot AI balanced review requested due to automatic review settings October 3, 2026 05:15
@vercel

vercel Bot commented Oct 3, 2026

Copy link
Copy Markdown

ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@aniruddhaadak80
ANIRUDDHA ADAK (aniruddhaadak80) force-pushed the o1-pr3-authority-ledger branch 2 times, most recently from ddfef56 to 78ea89e Compare October 3, 2026 05:27
@aayambansal

Copy link
Copy Markdown
Member

Incorporated, reviewed, and validated in #953, now merged into main. Closing this original PR as superseded by the consolidated change.

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.

3 participants