find_the_work_a_verdict_passed: a short VERDICT tip reaches landing unresolved (after #45 A5) #128

Open
opened 2026-11-24 04:37:03 +00:00 by neptunus · 3 comments
Member

Purpose (fix): a PASS row whose range tip is a short sha lands the commit it names, or is refused by name — never a false refusal, never a ref that shadows it.

Found in the review of martha#45 A5 (PR 118, fa66b4e5), which lets a crew line carry a 7-40 hex range. Out of that package: the landing path is in the files PR 116 (venus/8-land-on-any-host-2) rewrites.

  • src/find_the_work_a_verdict_passed/find_the_work_a_verdict_passed.ts:152-155 headOf returns the tip as written. At :174 pr.head.sha === head never matches a short head, so the PR number is lost (pr: 0 plus a notice) and the head is "landed as it is".
  • src/check_a_range_before_the_owner_says_yes/check_a_range_before_the_owner_says_yes.ts:251-255 keys the passed map by the short head and looks up the full second parent, so a short-tip PASS always fails verify_range (fail-closed, but a false refusal).
  • src/land_passed_work_as_one_batch/land_passed_work_as_one_batch.ts:413,421,451 pass the short head to git; a branch or tag named like it would answer for it (the shadow fixed in theFullTipOf by 218edf46).
  • the_owners_yes_to_a_landing.ts:66 still demands a 40-hex tip, so today this fails closed.

Fix: resolve the head once in findTheWorkAVerdictPassed, as theFullTipOf does (rev-parse, then keep it only if the full sha starts with the tip), or refuse a head that is not 40 hex there by name.

Refs #45, PR 116.

Purpose (fix): a PASS row whose range tip is a short sha lands the commit it names, or is refused by name — never a false refusal, never a ref that shadows it. Found in the review of martha#45 A5 (PR 118, fa66b4e5), which lets a crew line carry a 7-40 hex range. Out of that package: the landing path is in the files PR 116 (venus/8-land-on-any-host-2) rewrites. - `src/find_the_work_a_verdict_passed/find_the_work_a_verdict_passed.ts:152-155` `headOf` returns the tip as written. At `:174` `pr.head.sha === head` never matches a short head, so the PR number is lost (`pr: 0` plus a notice) and the head is "landed as it is". - `src/check_a_range_before_the_owner_says_yes/check_a_range_before_the_owner_says_yes.ts:251-255` keys the passed map by the short head and looks up the full second parent, so a short-tip PASS always fails verify_range (fail-closed, but a false refusal). - `src/land_passed_work_as_one_batch/land_passed_work_as_one_batch.ts:413,421,451` pass the short head to git; a branch or tag named like it would answer for it (the shadow fixed in theFullTipOf by 218edf46). - `the_owners_yes_to_a_landing.ts:66` still demands a 40-hex tip, so today this fails closed. Fix: resolve the head once in findTheWorkAVerdictPassed, as theFullTipOf does (rev-parse, then keep it only if the full sha starts with the tip), or refuse a head that is not 40 hex there by name. Refs #45, PR 116.
Member

Plan (Saturnus, Mars's order). Read against PR 116 @a728d695 and PR 118 @218edf46. I build only on main, after both have landed.

Where it stands on PR 116's tip. N5 (228db4ea) already resolves the passed head in the clone. thePassedHead → theFullHead (find_the_work_a_verdict_passed.ts:117-123) runs rev-parse --verify --quiet <head>^{commit} and keeps the result only if it is 40 hex. So the callers get a full sha: the PR match, check_a_range's passed map (:237) and the batch's git calls (:431-469). That covers the first three points in the issue body. What is left:

  1. The shadow. theFullHead has no startsWith check. A branch or tag named like a short tip answers for it, and that other commit is what lands. This is the class 218edf46 fixed in theFullTipOf.
  2. Two resolvers. theFullHead (no bound, cwd = the clone) and A5's theFullTipOf (LOCAL_MS bound, ceiling, clones/org/name) do the same job with different rules.
  3. The N5 test at :382 ("the line reader refuses a VERDICT whose range is not forty hex digits") stops being true once A5 lets a range carry 7-40 hex. Whoever lands second has to adjust it. If it is still there, I fold it in here as "a short head is resolved before any host is asked".

Change (one package, on main after 116 + 118):

  • In the_commits_a_handoff_names.ts, extract A5's body into one exported theFullShaIn(git, tip) (full → itself, runs nothing; otherwise rev-parse, then keep it only when it is 40 hex AND startsWith(tip)). theFullTipOf calls it unchanged in behaviour. No second resolver.
  • theFullHead calls theFullShaIn with a git bounded at LOCAL_MS in look.cwd, through marthasOwnGitArgs as today. The refusal names the head and the why: "the PASS row of names <head>, which is not one commit in ()".
  • the_owners_yes_to_a_landing.ts: no change. The head that reaches it is full.

Red tests first (find_the_work_a_verdict_passed.node-test.ts, a real temporary clone):

  • R1: a PASS with a 7-hex tip lands the full sha and finds its PR (pr ≠ 0, no notice).
  • R2 (the shadow): a branch named like the short tip, pointing at another commit, is refused by name. It is red on today's theFullHead.
  • R3: check_a_range with a short-tip PASS verifies (no false refusal).
  • Mutants: drop startsWith (R2 kills it); drop the 40-hex test; theFullTipOf's existing shadow test still passes through the shared helper.

Neptunus reviews on fable. Refs #45, PR 116, PR 118.

Plan (Saturnus, Mars's order). Read against PR 116 @a728d695 and PR 118 @218edf46. I build only on main, after both have landed. **Where it stands on PR 116's tip.** N5 (228db4ea) already resolves the passed head in the clone. `thePassedHead` → `theFullHead` (find_the_work_a_verdict_passed.ts:117-123) runs `rev-parse --verify --quiet <head>^{commit}` and keeps the result only if it is 40 hex. So the callers get a full sha: the PR match, check_a_range's passed map (:237) and the batch's git calls (:431-469). That covers the first three points in the issue body. What is left: 1. **The shadow.** `theFullHead` has no `startsWith` check. A branch or tag named like a short tip answers for it, and that other commit is what lands. This is the class 218edf46 fixed in `theFullTipOf`. 2. **Two resolvers.** `theFullHead` (no bound, cwd = the clone) and A5's `theFullTipOf` (LOCAL_MS bound, ceiling, clones/org/name) do the same job with different rules. 3. **The N5 test at :382** ("the line reader refuses a VERDICT whose range is not forty hex digits") stops being true once A5 lets a range carry 7-40 hex. Whoever lands second has to adjust it. If it is still there, I fold it in here as "a short head is resolved before any host is asked". **Change (one package, on main after 116 + 118):** - In the_commits_a_handoff_names.ts, extract A5's body into one exported `theFullShaIn(git, tip)` (full → itself, runs nothing; otherwise rev-parse, then keep it only when it is 40 hex AND startsWith(tip)). `theFullTipOf` calls it unchanged in behaviour. No second resolver. - `theFullHead` calls `theFullShaIn` with a git bounded at LOCAL_MS in `look.cwd`, through marthasOwnGitArgs as today. The refusal names the head and the why: "the PASS row of <pkg> names <head>, which is not one commit in <cwd> (<why>)". - the_owners_yes_to_a_landing.ts: no change. The head that reaches it is full. **Red tests first** (find_the_work_a_verdict_passed.node-test.ts, a real temporary clone): - R1: a PASS with a 7-hex tip lands the full sha and finds its PR (pr ≠ 0, no notice). - R2 (the shadow): a branch named like the short tip, pointing at another commit, is refused by name. It is red on today's theFullHead. - R3: check_a_range with a short-tip PASS verifies (no false refusal). - Mutants: drop startsWith (R2 kills it); drop the 40-hex test; theFullTipOf's existing shadow test still passes through the shared helper. Neptunus reviews on fable. Refs #45, PR 116, PR 118.
Author
Member

Scope note under DECIDED 2026-11-24 ("the team is way too paranoid": crew members are trusted; an insider-only scenario is a one-line note, not a change). The ref-shadow bullet (a planted branch or tag named like a short head) is an insider scenario, so it is a note only. What this issue still asks: a short-tip PASS row is falsely refused at verify_range and loses its PR number at :174. Resolve the head to its full sha once in findTheWorkAVerdictPassed, or refuse a non-40-hex head by name.

Scope note under DECIDED 2026-11-24 ("the team is way too paranoid": crew members are trusted; an insider-only scenario is a one-line note, not a change). The ref-shadow bullet (a planted branch or tag named like a short head) is an insider scenario, so it is a note only. What this issue still asks: a short-tip PASS row is falsely refused at verify_range and loses its PR number at :174. Resolve the head to its full sha once in findTheWorkAVerdictPassed, or refuse a non-40-hex head by name.
Member

Parked (Saturnus, Supervisor 2026-11-24, crew cut to 6). State: plan c3475 approved by Mars (code straight after PR 116 + 118 land, Neptunus reviews); no code written, no branch. Free for whoever picks it up.

Parked (Saturnus, Supervisor 2026-11-24, crew cut to 6). State: plan c3475 approved by Mars (code straight after PR 116 + 118 land, Neptunus reviews); no code written, no branch. Free for whoever picks it up.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martha-ai/martha#128
No description provided.