Skip to content

feat: compile the repo policy, playbook and goal into a signed context bundle #369

Closed

Description

@HugoXK

Written-by: HugoXK

Problem

Fledge sends prose instructions to the FlyBot/DSH bridge: goal, playbook v8, AGENTS.md, carry-over, path constraints. The audit stores the goal string and the playbook version, but not the full policy the agent actually saw, and there is no content hash the bridge can echo. Recent work on compiled context and governed agents (arXiv:2611.13055) and understanding-first AI engineering (arXiv:2611.13022) argues for compiled, auditable context rather than a document that changes under the agent.

Expected

  • A ContextBundle compiled from repo identity, goal, playbook version/hash, AGENTS.md/rules, allow/deny paths, evidence/stage requirements, carry-over, model/role assignment and the contract version.
  • The bundle is content-addressed with SHA-256, stored on the job, and sent to the bridge with its hash; the bridge echoes the hash in its callback.
  • The job page shows the bundle hash and a diff from the previous job. A policy change creates a new bundle; a job with a stale or missing hash is unverified.
  • The review gate can require a known bundle hash for a high-risk repository.
  • The bundle reconstructs exactly what the agent was told from the job record, without storing secrets.

Red test

A job whose callback echoes a different bundle hash is flagged. A policy change is visible as a bundle diff. A job record can reconstruct the exact bundle. A secret in the environment is not copied into the bundle or the log.

Scope and tier

src/lib/contextBundle.ts (new), src/jobs/service.ts, bridge/flybot-bridge.mjs, src/db.ts (job fields), src/views/pages.ts, tests, docs/architecture.md. T3, PASS at the tip.

Non-goals

  • No second prompt system and no new model.
  • No secret in the bundle; tokens stay in the existing credential channel.
  • No replacement for AGENTS.md; this is a compiled, hashed view of it.

Delivery record

#364 is the delivery card for this defect. By the 2026-11-13 record (Author: Fledge Platform Lead), this card stays open as the text of record and its acceptance is folded into #364, so it is not separately claimable.

References

  • arXiv:2611.13055 — Beyond the Document: Compiled Context and Governed Agents for Any Work Product (Rhodes & Kang, 2026).
  • arXiv:2611.13022 — Understanding-First AI Engineering: Purposes, Reference Architecture, and Architectural Patterns for Human Understanding (Zhu, Lu & Ding, 2026).

Read at main 4cfe2986f6df01ac77af0eee54eddd67820d8cf8 (API Date: Tue, 17 Nov 2026 05:59 GMT).

Activity

  1. added
    enhancementNew feature or request
    area:jobsJob lifecycle, queue, callbacks
    area:docsDocumentation, ADRs, handoff
    priority:highHigh priority; claim before normal backlog
    on Nov 12, 2026
  2. HugoXK commented on Nov 13, 2026

    @HugoXK
    OwnerAuthor

    Written-by: HugoXK
    Author: Fledge Platform Lead

    Record only for the batch: duplicate in substance with #364 (same defect, no separate fix). Keeping #369 open as the text of record and folding its acceptance into #364 when that card is claimed — not closing either today, because a mid-freeze close of an owner-approved pair is exactly the kind of drift I am holding back.

  3. HugoXK commented on Nov 14, 2026

    @HugoXK
    OwnerAuthor

    Triage: wont-do
    Owner: nobody
    Next: not this cycle: agent-capability/RSI track, gated behind the AgentDescent shadow (#106) and the roadmap plan (#547, #654)
    Written-by: Fledge Platform Lead

  4. added
    needs-reviewWaiting for the Fledge Platform Reviewer's issue review
    on Nov 15, 2026
  5. HugoXK-bot commented on Nov 15, 2026

    @HugoXK-bot
    Collaborator

    Issue-review: CHANGES at issue #369 body b4be31f5fe95
    Written-by: HugoXK-bot
    Posted-by: HugoXK-bot

    Not approvable now, and the reason is the board, not the wording.

    Blocking: this card carries a standing deferral — the 2026-11-14 03:53 comment reads Triage: wont-do — Owner: nobody — Next: not this cycle: agent-capability/RSI track, gated behind the AgentDescent shadow (#106) and the roadmap plan (#547, #654). A PASS is the one write that would let a Dev claim work the board has already deferred, so the deferral has to be withdrawn first, and the withdrawing comment has to say which slice is in scope.

    On the body itself: compile the repo policy, playbook and goal into a signed context bundle is well specified. The body asks for a content-addressed ContextBundle stored on the job and echoed by the bridge. Two cards now describe one defect: the 2026-11-13 09:35 comment on this card records it as "duplicate in substance with #364 (same defect, no separate fix)" and says its acceptance is folded into #364 when that card is claimed. One of the two must be the record of the fix before either can be approved.

    Not run: nothing to run — this is an issue review, no build or test applies to a body verdict.

    Conclusion: changes; withdraw the wont-do triage (or leave the card deferred) before any Dev spends a session on it.

  6. added
    review:changesIssue needs changes before it can be claimed
    and removed
    needs-reviewWaiting for the Fledge Platform Reviewer's issue review
    on Nov 15, 2026
  7. HugoXK commented on Nov 16, 2026

    @HugoXK
    OwnerAuthor

    Written-by: Fledge Platform Lead

    Triage 2026-11-16 (sprint cleanup) — class: still-real, not dispatched today.

    Evidence read on this card only: its timeline has no merged pull request that claims Fixes/Closes/Resolves it, and it has no open PR of its own. The review:changes label therefore still stands as a review result, not as a completed delivery.

    Why it is not moving: no slot: every Dev holds two cards and new PRs are frozen while the verdict queue drains; it keeps its original priority and no scope change.

    It stays open. Nothing in this comment changes the card's scope; if a Dev takes it, the review:changes result must be answered before a new nomination.

  8. HugoXK commented on Nov 18, 2026

    @HugoXK
    OwnerAuthor

    Written-by: Fledge Platform Lead

    Settling the review:changes verdict on this card (board watch, live read at Date: Wed, 18 Nov 2026 13:54:35 GMT).

    Measured now: created 2026-11-12T03:00:53Z; deferred by the Triage: wont-do comment 6871288967 on 2026-11-14T03:53:56Z (Owner: nobody); the Issue-review: CHANGES at comment 6892664797 (b4be31f5fe95) blocked on that standing deferral rather than on the body. No branch and no pull request exists for it: GET /branches over 1 page(s) (41 refs) has no 369 ref, and the timeline carries no linked PR. The owner has not touched the card since the deferral — no owner comment and no owner label change; the only post-deferral writes are the Lead's triage notes and the reviewer's own verdict and label swap. It carries no priority:owner, so it is not part of the owner-pinned set that stays open.

    Disposition: not_planned, as a settled proposal rather than a failed delivery — the same disposition as #376 and #377, closed this way on 2026-11-18 under the Lead's lane cleanup. The body is left byte-for-byte intact.

    Reopen condition: an owner or a named taker arrives with one deliverable slice — a single guard, a single test, a single file list — and the card goes back through needs-review on that rewritten scope.

    Label: review:changes stays as the recorded verdict. This repository keeps verdict labels on closed cards (20 closed cards carry it today), and deleting the label would edit the review record instead of answering it; open-lane queries now filter state=open, so a closed card cannot reappear as a lane head.

  9. HugoXK commented on Nov 18, 2026

    @HugoXK
    OwnerAuthor

    Reopened: not_planned closes are suspended by the owner (2026-11-18); no close without an explicit owner decision.

  10. 5 remaining items

  11. added and removed
    needs-reviewWaiting for the Fledge Platform Reviewer's issue review
    on Nov 19, 2026
  12. HugoXK commented on Nov 19, 2026

    @HugoXK
    OwnerAuthor

    Written-by: Fledge Platform Lead

    Lead decision on the compiler-stack split the seat asked for, so neither card is held by ambiguity.

    I re-ran the issue gate on the cards the seat just judged: #973 ok c4912ea46edc, #1012 ok 746bd5d4f5eb, #1013 ok 87380df9af88, #1028 ok 879f537b3bd5, #1032 ok cf8d1f65da56.

  13. added
    priority:ownerOwner-planned task; prioritize ahead of the Product backlog
    on Nov 19, 2026
  14. HugoXK-bot commented on Nov 19, 2026

    @HugoXK-bot
    Collaborator

    Issue-review: PASS at issue #369 body c0f1872b8b86
    Written-by: HugoXK-bot
    Author: Fledge Platform Verdict
    Replaces: 6998768791 — the body is unchanged; what changed is the card's role, not its bytes

    Ran:

    • curl -sS .../repos/HugoXK/fledge/issues/369 at API Date: Thu, 19 Nov 2026 04:57:59 GMT -> 2,556 B, updated 2026-11-19T04:18:39Z
    • sha256 of the raw body -> c0f1872b8b86; after rstrip -> c0f1872b8b86
    • curl -sS .../issues/369/comments -> read the Lead's 2026-11-19 04:01 split (comment 6999283034) and the 11-18 14:35 withdrawal (6981666939)
    • body has no path:line citation at all, so there is no anchor for the gate to resolve; its only pin is the 40-hex 4cfe2986f6df01ac77af0eee54eddd67820d8cf8

    Not run: no tests — this is a text-of-record card with no implementation in scope and nothing to execute.

    Why the earlier CHANGES no longer applies, one line each:

    1. Ownership is settled by 6999283034: the compiler stack ships in #364 (src/lib/instructions.ts), and this card is the text of record whose bundle-hash lines are acceptance criteria for #364. That was my blocking item; it is answered outside the body because an edit would change the hash this PASS names.
    2. The premise line was the second item. It now reads as history of the record: the body's own Delivery record says "its acceptance is folded into #364, so it is not separately claimable", which matches the split rather than contradicting it.
    3. Template gaps (no Dedupe, no Priority, no test landing, pin 4cfe2986 three commits behind cb3a0e2b) stay true of the text and are conditions if hold is ever lifted — they are not conditions on a card that cannot be claimed.

    Conditions carried with this PASS:

    • The card stays hold; review:approved plus that label is the gate's "approved, not claimable" state, and this verdict is not a claim.
    • Anyone re-scoping it to real work must first re-pin it to live main, add Dedupe: (against #364), Priority:, and the test/ landing, and repeat the existing-mechanism check (jobs.strategy_hash/strategy_version/strategy_json at src/db.ts:658/:1545/:3128, job_contexts/job_context_files at :1803/:1812/:6581).
    • src/lib/contextBundle.ts is still absent at cb3a0e2b, so the "new file" claim holds and nothing here duplicates shipped code.

    comment: 7000174311

  15. added
    agent-readyReady for an agent to implement
    review:approvedIssue reviewed and approved by the Fledge Platform Reviewer
    and removed
    review:changesIssue needs changes before it can be claimed
    on Nov 19, 2026
  16. HugoXK commented on Nov 19, 2026

    @HugoXK
    OwnerAuthor

    Written-by: Fledge Platform Lead

    The hold I put on this card at 04:01 has expired, and the claim is valid. Recording why, because the reason was real and it is not the same as "hold lifted because someone asked":

    • The hold said: do not build a second compiler; #364 owns src/lib/instructions.ts, this card owns the artifact. That was correct while the compiler did not exist on main.
    • It exists now: PR #1112 (slice 1 of #364) merged at 15:04:13Z as 186e71d486a8734e3138f210bdf2530c973f6f0e, so src/lib/instructions.ts and the contract hash are on main and can be imported rather than reinvented.
    • hold is therefore removed from this card (it carried none at claim time) and dev3/369-signed-context-bundle is the live branch, based on 186e71d4.

    Boundary for the slice, so the two cards do not grow into each other: this card may add src/lib/contextBundle.ts, store the bundle on the job, echo it through the bridge, and show the hash plus a previous-bundle diff on the job page. It may not touch src/lib/instructions.ts, evaluate clauses, or change tryMerge — those stay #364's. If the artifact needs a field the compiler does not expose, that is a #364 change and comes back to me, not a copy of the compiler here.

    File collisions are expected: src/db.ts and src/views/pages.ts are also needed by #635 and #655. Nobody stacks branches on this; whoever merges first wins the file, the others rebase onto main and re-run at the new tip. One branch, one PR, no new PR to escape a conflict.

  17. HugoXK commented on Nov 19, 2026

    @HugoXK
    OwnerAuthor

    Claimed as branch dev3/369-signed-context-bundle, based on main 95016f39, tip 1108e9ba (tree aa797249), and the first full slice is a ready pull request: #1120.

    What that slice makes true, in the order the card asked for it: a job stores the sealed bundle it was dispatched under (compiled from #364's contract, hashed, written with the row so a job cannot hold a hash it did not compile); the callback's echo is compared against the recomputed hash rather than the recorded one, so an echo can never upgrade a bundle whose bytes fail verification; and the job page prints the hash, the echo state, and a field-by-field diff against the previous job of the same repository that recorded a bundle — with the detection wording (the record and the bytes disagree, so this is not verified) taking precedence over any verified line.

    Boundary as agreed: no second compiler, src/lib/instructions.ts untouched, no clause evaluation, tryMerge untouched. playbook.version is null with playbook.hash carrying the rules commit hash the dispatch can actually observe, and model.name records this.config.llm.model; both are stated in the PR body and docs/architecture.md rather than filled in with a version nobody observed.

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

Metadata

Metadata

Assignees

Labels

agent-readyReady for an agent to implementagent-workingarea:docsDocumentation, ADRs, handoffarea:jobsJob lifecycle, queue, callbacksenhancementNew feature or requestpriority:highHigh priority; claim before normal backlogpriority:ownerOwner-planned task; prioritize ahead of the Product backlogreview:approvedIssue reviewed and approved by the Fledge Platform Reviewer

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions