Workbench store + brain write-permissions (t-243) - #79
Open
mahoudeau wants to merge 1 commit into
Open
Conversation
bureau-internal/23 step 3, two outcomes per the mission body: (a) /api/work: an ungitted per-mission evidence store (hub/lib/work.js). Same attachment shape as /api/knowledge (base64 binaries, 5MB cap, same extension whitelist) but plain filesystem under BUREAU_WORK_DIR, no git commit, no provenance, no lint - evidence is not knowledge (boss ruling). Scoped under work/<t-id>/, wholesale garbage-collected the moment that mission's status becomes terminal (done/failed/discarded), wired into every door that can terminate a mission: PATCH /api/tasks/:id, the MCP update_mission tool, and the boss's approve capability-link. (b) Per-compartment write permissions, hub-enforced in knowledge.js the same role-not-name way t-119 enforces gates: knowledge/, recipes/ (global and entity), entities/*/PROFILE.md, and attic/ are writable via POST /api/knowledge only by a librarian-capability agent or 'human' - 403, refused before it ever touches disk or git. journal/ and project trees are unaffected. The same wall applies to the MCP write_knowledge tool (consul is not a name-based exemption). docs/protocol.md and docs/brain-format.md updated per the mission's own scope. Conformance grows two new sections in test/dummy-agent.sh: protected-compartment refusal/acceptance/journal-stays-open (both REST and MCP), and the work store round-trip + GC-on-terminal-status (both the REST PATCH path and the MCP update_mission path). Ran locally against a fresh scratch hub: 170/170 checks pass, 0 failures. Not done here (deliberately, matching this mission's stated body, not doc 23's broader musing): a hub-side mechanical check of sol's provenance floor (refusing knowledge writes with no source link) - that's content validation, a different concern from the write-ACL this mission actually asks for, and this mission's own body only names two outcomes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0192LDwTNhegzGYK1Ke8yQ3s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bureau-internal/23step 3. Mission: t-243. Oneknowledge.jsmission, two outcomes per the mission body:(a)
/api/work— an ungitted per-mission evidence storeNew
hub/lib/work.js. Same attachment shape as/api/knowledge(base64 binaries, 5MB cap, same extension whitelist) but plain filesystem underBUREAU_WORK_DIR(defaulthub/work/) — no git commit, no provenance, no lint. Boss ruling: evidence is not knowledge.Scoped under
work/<t-id>/, wholesale garbage-collected the moment that mission's status becomes terminal (done/failed/discarded), wired into every door that can terminate a mission so cleanup never depends on which surface closed it:PATCH /api/tasks/:idupdate_missiontool/r/:token)(b) Per-compartment write permissions, hub-enforced
Same role-not-name pattern t-119 uses for gates (
hub/lib/store.jsgainsisLibrarian, exported alongside the existingagentHasCapability/isLead/isCriticOrLead).knowledge/,recipes/(global and entity),entities/*/PROFILE.md, andattic/are writable viaPOST /api/knowledgeonly by a librarian-capability agent orauthor: "human"— refused with a403before it ever touches disk or git, nothing partially applies.journal/and project trees are unaffected. The same wall applies to the MCPwrite_knowledgetool — consul is not a name-based exemption, it earns library write access the same way any other agent does.Docs
docs/protocol.md:/api/workdocumented (table grows to "the eight calls"), the write-permission rule spelled out next to the existing boss-gate authorization paragraph it mirrors.docs/brain-format.md: the curation-law table marks which rows are now hub-enforced (⚙) vs. still convention-only; the binary-attachment paragraph now points evidence at/api/workinstead ofdeliverables/.Conformance
Two new sections in
test/dummy-agent.sh:knowledge/,recipes/, entityknowledge/, entityPROFILE.md, andattic/; a librarian-capability agent andhumanboth accepted;journal/and project trees stay open — both the REST route and the MCPwrite_knowledgetool./api/workwrite/read/list/base64-attachment round-trip, off-whitelist refusal, not protected-compartment-gated, evidence survives while the mission is open, gone the instant it goes terminal, a 404 (not an error) reading a GC'd file, and GC firing from the MCPupdate_missionclose path too.Ran locally against a fresh scratch hub (
BUREAU_DATA_DIR/BUREAU_BRAIN_DIR/BUREAU_WORK_DIRisolated,BUREAU_PUBLIC_URLunset so the MCP door resolves to localhost): 170/170 checks pass, 0 failures.Deliberately not done here
A hub-side mechanical check of sol's provenance floor (refusing a knowledge write whose body carries no
(source: [[...]])link) — that's content validation, a different concern from the write-ACL this mission's own body actually asks for (two outcomes, (a) and (b) above, no third). Doc 23 mused it might "ride along... anyway" but the lead who cut this mission didn't put it in the Acceptance, so it isn't in this diff.Gate is
boss(protocol change) — same situation as t-242 (PR #78): this session can't clear agate: bossmission intoreviewitself (hub-enforced), so t-243 parksblockedwith a note rather than forcing a status the hub would refuse.Generated by Claude Code