Skip to content

orchestrate.py status: build_status mis-attributes markers (ignores marker.number), so quoted grammar examples poison the board #54

Description

@TBarregren

Summary

The orchestrate.py status board (added in #50) attributes every orchestrate: marker it finds in an issue's comments to that issue, without checking marker.number. Because the milestone grammar deliberately carries the issue number inside each marker (orchestrate: started #47, …) precisely so attribution is verifiable, any comment that merely quotes a marker — most notably #48's own Agent Brief, which quotes the grammar in code fences — poisons the board. Demonstrated live: feeding the documented status one-liner's real payload renders a bogus #48 working started scoped to the placeholder run <runId>. A related lower-severity gap lets an unsubstituted run <runId> template parse as a real run id and pool with those quoted examples.

Severity: MEDIUM (+ a folded LOW). The feature is an auxiliary read-only board, but it silently shows the wrong state, which is worse than showing nothing for a tool whose whole job is trustworthy at-a-glance status.

Evidence (verified)

  • scripts/orchestrate.py:1708 load_status_universe reads each issue's comments through parse_landed_marker and appends every parsed marker to that issue's StatusIssue, with no marker.number == entry["number"] comparison:
    marker = parse_landed_marker(str(body or ""))
    if marker is None:
        continue
    ...
    issue_markers.append(StatusMarker(marker, created_at, sequence))
  • parse_landed_marker is deliberately prose-tolerant (a orchestrate: interrupt-safe restart — detect a dead cross-session resume, never re-implement landed work #49 property that was safe when only preflight consumed it — preflight also demands a hex SHA that is an ancestor of the default tip, a second factor status has no equivalent of).
  • Live demonstration (integration review): issue orchestrate: continuous out-of-band progress reporting for multi-hour runs (status command + durable milestone markers) #48's Agent Brief quotes orchestrate: started #47, run <runId> inside a code fence. Running the documented one-liner over real GitHub data renders #48 working started under bogus run <runId>.
  • Amplifier (terminal fallback): the read path's any-run landed/opened-prdone fallback deliberately ignores run scoping, and opened-pr needs only digits (unlike landed, whose [0-9a-fA-F]+ SHA rejects placeholder text). So a comment anywhere quoting orchestrate: opened PR #12, run x renders that issue done in every run scope.
  • Folded LOW (finding 4): the JS milestone templates hand the reporter literal run <runId> to substitute (RUN_ID_HINT). If a reporter posts it unsubstituted, the \S+ run_id capture accepts <runId> as well-formed; since orchestrate: continuous out-of-band progress reporting for multi-hour runs (status command + durable milestone markers) #48's brief examples also carry run <runId>, all such markers pool into one phantom run that _resolve_run may pick as the default scope. No write-side guard, no read-side placeholder rejection.

Root-cause analysis (cause → effect)

  1. Design seam. orchestrate: continuous out-of-band progress reporting for multi-hour runs (status command + durable milestone markers) #48 put the issue number inside the marker so a reader can verify which issue a marker is about. orchestrate: deterministic status command + push notifications (deferred R1a/R1c from #48) #50's consumer never used that field.
  2. Prose tolerance meets a weaker consumer. parse_landed_marker was intentionally lenient because its only prior consumer (preflight) had a strong second factor (ancestor-SHA check). status reuses the parser but has no second factor, so leniency that was safe becomes a liability: any marker-shaped text is trusted.
  3. Effect. Documentation, briefs, and even chat that quote the grammar become "markers" attributed to whatever issue hosts the comment → wrong rows. The terminal-verb fallback and the <runId> placeholder widen the blast radius from "wrong phase" to "falsely done" and "phantom default run".

Impact / blast radius

Proposed solution ideas

  1. Attribute by number (primary fix). In load_status_universe (or build_status), drop any marker whose number is set and differs from the hosting issue's number. Milestone verbs always carry the number, so this is a clean, cheap filter and the correct second factor status was missing.
  2. Reject placeholder run ids. Treat a run_id of <runId> — or any <…>-bracketed / non-substituted token the sanitiser-free \S+ capture admits — as malformed on the read path (parse to None / exclude from _resolve_run). Optionally tighten the run_id capture to exclude angle brackets. Add a parser test that an unsubstituted-template comment parses to None.
  3. Constrain the terminal fallback. For the number-less terminal path, either require milestone/terminal corroboration, or restrict the any-run landed/opened-prdone fallback to markers whose run_id is not a placeholder, so a quoted opened PR can't mark an issue done everywhere.
  4. Red-first test (required by house TDD). An issue whose comments quote another issue's markers (and a prose-quoted opened-pr marker, and an unsubstituted <runId> template) must render queued. Demonstrate the test red against current build_status, then green after the filter.

Acceptance criteria (sketch)

  • A marker whose number differs from the hosting issue is ignored by status (verified by a red-first test using orchestrate: continuous out-of-band progress reporting for multi-hour runs (status command + durable milestone markers) #48's own quoted-example payload → the issue renders queued).
  • An unsubstituted run <runId> (or any bracketed placeholder run id) does not parse as a valid run and cannot become the default run scope.
  • The terminal landed/opened-prdone fallback cannot mark an issue done from a quoted marker on an unrelated issue.
  • parse_landed_marker remains the single source of truth (no ad-hoc parsing); the fix lives in the consumer/attribution layer.
  • Coverage added to tests/test_orchestrate_status.py; existing status tests still green.

Provenance

Discovered by the mandatory integration review of the orchestrate run wf_2d1a01f8-b49 (#48 + #50, merge mode) — a genuine cross-issue defect no per-issue verifier could see (seeing it meant reading the brief of issue 48 against the consumer added by issue 50). The run's fix-round cap was exhausted before this could be auto-remediated, so it is reported for a human. Findings 3 (MEDIUM) and 4 (LOW) folded here as one coherent fix.

Blocked by

Blocked by #52 (land the git-environment scrub first: until it lands, every hook-verified commit made while implementing this issue risks corrupting the real repository through the leaked GIT_DIR/GIT_INDEX_FILE).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions