Feat/research supervision ledger - #25
Conversation
There was a problem hiding this comment.
💡 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".
| clientDistribution, | ||
| }); | ||
| ledgerSave = appendResearchLedgerEntry(packet, { ledgerFile }); | ||
| report.supervisionLedger = { |
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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 👍 / 👎.
No description provided.