Skip to content

impl(fleet): fleet gh Metadata superset — create-path stamping + DB insert (extends #9016) #9073

Open

Description

@developing-today-fleet

Design: doc/2026-11-12T22-50-00Z_design_pm-board-hierarchy-genealogy/note.md section 13; extends the step-2 scope of #9016 (cross-linked). fleet gh issue/PR create parses any pm-metadata block already in the caller's description, stamps what fleet knows (queue ID, scheduled start, current time, pwd, worktree, host, queue pickup time, work start time, issues worked by the same lane start, session id, model), ensures required fields (injecting defaults/what it knows), pushes the item, then inserts the full record incl. full Metadata into the fleet database.

Acceptance:

  • Create via fleet gh with no block, a partial block, and a complete block: resulting bodies read back with correct stamps; caller-supplied values never overwritten.
  • DB row for the created item verified by query, full Metadata JSON round-trips.
  • A forced DB-insert failure leaves the GitHub item intact and the miss is picked up by the ingestion slice (cross-ref), demonstrated or reasoned with the sweeper test.
  • Plain gh behavior is unchanged when fleet gh is not used.

Activity

  1. developing-today commented on Nov 12, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 12, 2026

    @dezren39
    Member

    Amendment — Metadata schema-version doctrine (from the Atlas v1 program, 2026-11-12)

    Drew's 2026-11-12 directive (Atlas v1 program, starter #9091, doctrine issue #9095, proto design doc/2026-11-12T23-59-00Z_design_atlas_v1_proto/note.md §C) establishes a schema evolution doctrine shared by the Atlas corpus metadata and the issue/PR Metadata specified in #9060 §12. It binds this slice:

    • The Metadata block always carries its schema version (the pm_meta field in §12's example is that version, now governed — not just a marker).
    • Additive-only evolution: a version bump may add fields/enum values; it may never remove a field or make an optional field required.
    • Breaking changes are parked in the breaking-changes parking lot (created under design(atlas+pm): Metadata schema v1 + evolution doctrine — additive-only, extras, strict enums, breaking-change parking lot #9095) and applied as one set in a single version event, followed by a reclassify-everything pass.
    • Readers accept every prior version indefinitely — this slice's create/stamp path must never reject or silently drop Metadata written at an older version; caller-supplied values at any version are never overwritten (consistent with this issue's existing acceptance).
    • Extras + type-mismatch handling: unlisted keys live in an extras dictionary; a value whose type mismatches the declared field type is treated as an extra, never an error (coercion rules in the doctrine). Required-field injection by this slice operates within those rules — injecting a default must not "repair" a type-mismatched caller value out of extras.

    Acceptance addition: a create carrying an older-version block and a type-mismatched field round-trips with the value preserved in extras and the version doctrine intact.

  3. dezren39 commented on Nov 13, 2026

    @dezren39
    Member

    Cross-link: #9178 (fleet queue: resume-by-session, claim-any-task, and manual-only items) depends on this create-path provenance stamping for claim/resume audit records, and its §5 proposes extending the same attribution idea — a fleet-init run ID carried into GitHub operations plus a complete transaction log — as an explicit decision item (seeded as FDR-0005 in #9180), not an adopted design.

  4. 32 remaining items

  5. dezren39 commented on Nov 23, 2026

    @dezren39
    Member

    Picked up by felix — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while felix posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  6. dezren39 commented on Nov 23, 2026

    @dezren39
    Member

    Slice 9 (the native fleet gh Metadata create path) is implemented and up for review: PR #12988 (unmerged, branch felix/9073-metadata-create-path).

    What landed, per design §§12–15: fleet gh issue create / pr create bodies are parsed for the pm-metadata block (fail-closed — a malformed caller block refuses the create with exit 2 before any GitHub write), stamped with the full provenance set from fleet sources only (the queue record read from the broker for the caller's session binding; session state; host; worktree/workspace ref; agent identity; service clock), signed with the #12586 stamp signature when a key is configured, and — after a successful create — inserted in full into the metadata store (#9074's pm_metadata schema and extraction rules, ported over SQLite). A failed insert leaves the GitHub item intact, keeps gh's exit code, and prints a stderr note naming the miss for the §16 ingestion sweeper to heal (the hosted #12590 sweeper covers exactly this miss shape: an item whose stamped body exists but whose row is absent).

    Cross-edition conformance: the hosted edition's golden vectors from #12586 are reproduced byte-exact in the native test suite (canonical form and signature, hosted-key and native-key fixtures), so the native and hosted editions sign and verify each other's stamps.

    Evidence (amd-6, under the fleet build lock):

    • cargo test -p fleet --features full: 127 passed / 0 failed (23 new gh_metadata tests; pre-existing gh rotation/guard/closure suites unchanged).
    • E2E against a fake gh: 23/23 checks — the acceptance trio (no block / partial block / complete block) reads back with correct stamps, caller-owned values intact, caller-forged provenance replaced; the DB row round-trips by query including extracted columns and link rows; forced insert failure and malformed-block refusal behave as above.
    • Fail-before: the same e2e against the pre-change installed binary fails 13 of 23 checks (unstamped passthrough, no DB row, malformed block reaches gh).

    Design calls recorded (also in the PR body):

    New dependencies for the fleet crate (reported per house rules): ed25519-dalek 3 (deterministic signing as a library call — byte-exactness with the golden vectors is the conformance surface) and rusqlite 0.42 bundled (the same pin fleet-queue already carries). base64 0.23 was already an optional dep; the gh feature now enables it too.

    Remaining on this issue: Felix's review/merge of PR #12988. Slices 10–12 (#9074's wiring, session state, dual ingestion) are their own issues.

  7. dezren39 commented on Nov 23, 2026

    @dezren39
    Member

    Released by felix (outcome: done). Task 20273 / #9073 slice 9 implemented: native fleet gh Metadata create path (parse, stamp, insert) in PR #12988 (unmerged for Felix review). cargo test -p fleet --features full on amd-6: 127 passed / 0 failed incl. both #12586 golden vectors byte-exact; fake-gh e2e 23/23 (13 fail on the pre-change binary). Note on #9073: comment 7093434473. Primary-store completion refused (disposition reader reports invalid_no_work for an unmerged PR), so this fallback release is the close-out of record.

  8. added a commit that references this issue on Nov 23, 2026
  9. dezren39 commented on Nov 23, 2026

    @dezren39
    Member

    agent-note:v1
    event: PR #12988 MERGED — amendment slice 9 (fleet gh Metadata create path) landed
    by: agent felix (kind muse, Muse sandbox seat), merging after review
    at: 2026-11-23

    PR #12988 merged (+2622/−9, 6 files). Native fleet gh issue create / pr create are now Metadata-aware: the caller's pm-metadata block is parsed fail-closed (a malformed block refuses with exit 2 before any GitHub write), the §5/§13 provenance set is stamped in full from fleet sources only (caller-supplied provenance replaced wholesale; caller-owned fields preserved exactly), signed when a key is configured, and the full record is inserted into the metadata store after a successful create — a failed insert leaves the item intact, keeps gh's exit code, and notes the miss for the §16 sweeper (#12590) to heal.

    Felix's review: read the module contract in gh_metadata.rs (matches the design's failure posture exactly); the lane's evidence — cargo test -p fleet --features full on amd-6: 127/127 (23 new gh_metadata tests); fake-gh e2e 23/23 with fail-before 13/23 against the pre-change binary; and the conformance point of the slice: #12586's golden vectors reproduce BYTE-EXACT natively (canonical bytes and stamp_sig, both fixtures), and the native verifier accepts the hosted stamp. The hosted and native editions now provably speak the same signature.

    New dependencies (fleet crate, reported per house rule): ed25519-dalek 3 (deterministic signing as a library call; same major as id-worlds) and rusqlite 0.42 bundled (same pin fleet-queue already carries).

    #9073 stays open: slices 10–12 are separate issues.

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

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)status:in-reviewtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions