Skip to content

docs: behavior contracts — publication discretion, internal event model, Issue worktree - #145

Closed
xiaoland wants to merge 3 commits into
mainfrom
docs/behavior-contracts
Closed

xiaoland wants to merge 3 commits into
mainfrom
docs/behavior-contracts

Conversation

@xiaoland

@xiaoland xiaoland commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Docs-only contract patch from the v0.3.0 live-acceptance behavior review. Three commits, each one contract:

1. Publication Discretion (publication.md, app-server.md, glossary)
A delivered comment/review/mention never obligates a public reply; silence is a valid turn outcome. Private reasoning lives only inside the physical provider session and dies on Context Reset — durable conclusions must reach GitHub. The versioned Braid System Prompt must state this explicitly. (Today the prompt only implies restraint: "publish only concise Human-relevant comments".)

2. Platform-neutral internal event model (20-product-tdd/README.md, github.md, workflow.md)
protocol.rs owns a typed EventKind (assign/unassign/mention/wake/invalidate/lifecycle/origin_echo/noop); producers map platform deliveries at ingress; queue/group consume EventKind only — the seam where future non-GitHub platforms plug in. GitHub mapping table included. Two rulings folded in:

  • the first trusted mention on a dormant Work Item is the internal assign event — mention activation and native Agent App assignment become one contract;
  • a mention on a closed Work Item is a mention, not an assign: closed groups do not wake; reopen is the designed re-entry. (This rules on the live-observed deviation where @braid on closed issue Establish GitHub Context as Braid working memory #1 resurrected the group. Strike this line if you want explicit human mentions to override closure.)

3. Issue Agent worktree takeover (20-product-tdd/README.md, lifecycle.md, objects.md, glossary)
Every Agent Group session runs in a dedicated generation-scoped worktree, never the shared profile workspace. Issue Agent: worktrees/issue-<N>/<profile>-g<gen>, bound to the issue's sole same-repo Development linked branch when exactly one exists, else the default origin branch; several Development branches = ambiguous → materialization blocked with operator diagnostic (mirrors pr ensure). PR behavior unchanged. (Today only the PR agent gets a worktree; the issue agent runs in the shared profile workspace.)

No code changes; implementation follows after these contracts are accepted.

A delivered comment/review/mention never obligates a public reply;
silence is a valid turn outcome. Private reasoning lives only inside
the physical provider session, is never published by Braid, and dies
on Context Reset, so durable conclusions must reach GitHub. The
versioned Braid System Prompt must state this explicitly.
protocol.rs owns the typed EventKind contract (assign/unassign/mention/
wake/invalidate/lifecycle/origin_echo/noop); producers translate platform
deliveries at ingress and queue/group consume EventKind only. GitHub
mapping table added, including: the first trusted mention on a dormant
Work Item IS the internal assign event (unifying mention activation with
native Agent App assignment), and a mention on a closed Work Item is a
mention, not an assign - closed groups do not wake, reopen is the
designed re-entry.
Every Agent Group session runs in a dedicated generation-scoped worktree,
not the shared profile workspace. Issue Agent worktrees live at
worktrees/issue-<number>/<profile>-g<generation> and bind the issue's
sole same-repo Development linked branch when exactly one exists,
otherwise the default origin branch; several Development branches are
ambiguous and block materialization with an operator diagnostic
(mirroring pr ensure). Profile workspace remains the clean source
checkout. PR behavior unchanged.
@xiaoland

xiaoland commented Sep 1, 2026

Copy link
Copy Markdown
Owner Author

Superseded: contract commits cherry-picked into #142 (single acceptance branch).

@xiaoland xiaoland closed this Sep 1, 2026
@xiaoland
xiaoland deleted the docs/behavior-contracts branch September 1, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant