Skip to content

Feat/research supervision ledger - #25

Merged
darfaz merged 2 commits into
mainfrom
feat/research-supervision-ledger
Jun 19, 2026
Merged

darfaz merged 2 commits into
mainfrom
feat/research-supervision-ledger

Conversation

@darfaz

@darfaz darfaz commented Jun 19, 2026

Copy link
Copy Markdown
Owner

No description provided.

@darfaz
darfaz merged commit 493cf3a into main Jun 19, 2026
14 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1dbeaeefd

ℹ️ 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".

Comment thread bin/clawmoat.js
clientDistribution,
});
ledgerSave = appendResearchLedgerEntry(packet, { ledgerFile });
report.supervisionLedger = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Persist ledger metadata before writing --output

When --output and --ledger are used together (the README's documented flow), the JSON file is written before the ledger packet is appended and before report.supervisionLedger is added, so the retained research-preflight.json lacks the packet id, sequence, ledger path, and entry hash even though stdout has them. Move the output write after this block so the saved evidence receipt can be tied back to the supervision ledger entry.

Useful? React with 👍 / 👎.

const packet = latestPacketFor(entries, packetId);
if (!packet) throw new Error(`Research review packet not found: ${packetId}`);
const reviewer = opts.reviewer || 'unspecified';
if (String(reviewer).trim().toLowerCase() === String(packet.analyst || packet.submittedBy).trim().toLowerCase()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Check submittedBy when blocking self-approval

When a packet is created with a placeholder/default analyst but the real analyst in submittedBy (which createResearchReviewPacket explicitly accepts), this comparison stops at packet.analyst and never checks packet.submittedBy, allowing that submitter to approve their own research packet. Compare the reviewer against both identities, ignoring placeholders, so the self-approval guard cannot be bypassed in this common handoff path.

Useful? React with 👍 / 👎.

@darfaz
darfaz deleted the feat/research-supervision-ledger branch June 20, 2026 03:37
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