bubbles-result-envelope
Compose a valid Bubbles result envelope at the end of every agent invocation. Use when finishing any Bubbles agent task and about to return control to the orchestrator, when routing work to another specialist via a packet, or when emitting a continuation envelope from a read-only/advisory surface. Covers outcome vocabulary, finding accounting, addressedFindings/unresolvedFindings, and next-owner routing.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- bubbles-result-envelope
- description
- Compose a valid Bubbles result envelope at the end of every agent invocation. Use when finishing any Bubbles agent task and about to return control to the orchestrator, when routing work to another specialist via a packet, or when emitting a continuation envelope from a read-only/advisory surface. Covers outcome vocabulary, finding accounting, addressedFindings/unresolvedFindings, and next-owner routing.
03 SKILL.md 正文
Bubbles Result Envelope
Goal
Return work to bubbles.workflow (or another orchestrator) with a machine-readable envelope that carries enough provenance for the next routing decision, without hiding deferred findings or claiming work that did not happen.
When to use
- End of every
bubbles.*agent invocation - Returning from a subagent dispatch
- Emitting a continuation envelope from
bubbles.recap,bubbles.status,bubbles.handoff,bubbles.super - Routing a foreign-artifact finding to its owner
Repository Binding (repository-sensitive invocations)
Before consuming or emitting a repository-sensitive result, validate the inherited actionable packet with bubbles/scripts/repository-binding.sh validate-packet. The RESULT-ENVELOPE echoes this exact closed field set unchanged:
repositoryRootrepositoryAliasrepositoryResolution.sessionIdrepositoryResolution.decisionIdrepositoryResolution.controlRevisionrepositoryResolution.controlPathDigestrepositoryResolution.authorityrepositoryResolution.transitionrepositoryResolution.scopeKindrepositoryResolution.scopeIdrepositoryResolution.targetKindrepositoryResolution.pathVisibilityrepositoryResolution.actionable
Stale revisions, root substitution, cross-scope substitution, malformed packets, and public/redacted projections are refusals. Public projections use <redacted-local-root> with repositoryResolution.pathVisibility: redacted and repositoryResolution.actionable: false; they are non-actionable and cannot resume or dispatch work.
Envelope shape (terminal — completion or block)
## RESULT-ENVELOPE
agent: bubbles.<name>
mode: <workflow-mode>
spec: specs/<NNN-feature>
scope: SCOPE-<id> # if applicable
outcome: completed_owned | completed_diagnostic | route_required | blocked
addressedFindings:
- <finding-id>: <one-line resolution + evidence ref>
unresolvedFindings:
- <finding-id>: <one-line reason + suggested owner>
nextRequiredOwner: bubbles.<name> # only when outcome=route_required or blocked
reason: <one-line explanation>
evidenceRefs:
- specs/<NNN>/report.md#<section>
- specs/<NNN>/scopes.md#scope-<id>
Envelope shape (continuation — advisory surfaces)
For recap/status/handoff/super and read-only outputs that suggest how to continue:
## CONTINUATION-ENVELOPE
target: specs/<NNN-feature>
intent: <one-line natural-language goal>
preferredWorkflowMode: <mode-from-workflows.yaml>
tags: [<routing-tag>, ...]
reason: <why this is the next step>
provenance: # binding provenance (IMP-025 MR3)
repositoryRoot: <git-toplevel-of-edited-repo>
agentSourceRoot: <repo-slug the active agent was installed for>
frameworkVersion: <installed Bubbles version>
workBoundary: # immutable task scope (IMP-100 R6, optional)
repositoryRoots: [<repo-slug>, ...] # the ONLY repos this task may modify
specTargets: [specs/<NNN-feature>, ...] # optional: the in-scope specs
allowedPaths: [<glob>, ...] # optional: in-scope paths (dir/**, dir/, exact)
crossRepoPolicy: forbidden # forbidden (default) | authorized
The orchestrator routes continuation envelopes through bubbles.workflow, not directly to a specialist.
After terminal completion, a read-only surface emits the schema-valid redacted repository projection: repositoryRoot: <redacted-local-root>, repositoryResolution.pathVisibility: redacted, repositoryResolution.actionable: false, target: none, and preferredWorkflowMode: none. Repository alias and remaining decision provenance stay unchanged. Any possible next priority is listed outside the envelope as not started; a new explicit request must establish fresh authority before work begins.
Binding provenance (multi-root, IMP-025 MR3). The provenance block lets a resumed
session verify it is still bound to the intended repository + agent source. On resume, the
orchestrator MUST validate that the envelope's agentSourceRoot still matches the
repositoryRoot being edited (reuse bubbles/scripts/repo-binding-preflight.sh --repo-root <repositoryRoot> --agent-source <agentSourceRoot>); a mismatch is a REFUSE
(the resumed run is bound to a different workspace root than the handoff assumed). Canonical
framework-source work sets agentSourceRoot to the framework slug and passes via
--canonical-source. Omitting the block is permitted only for single-root sessions where
the marker is absent (the preflight is advisory there); populate it whenever the
.install-source.json targetRepoSlug marker exists. See
docs/guides/AI_ENVIRONMENT.md (Multi-Root Workspaces).
Work boundary (anti-wandering, IMP-100 R6). The optional workBoundary block declares
the immutable scope of the requested task so a session cannot drift into unrelated work (the
"works on repo A, starts fixing repo B" failure mode). Before touching any candidate change,
the orchestrator consults bubbles/scripts/work-boundary-resolve.sh --feature-dir <spec> --candidate-repo <slug> [--candidate-spec <id>] [--candidate-path <path>], which classifies
the candidate as in-boundary (proceed inline), route-same-repo (unrelated same-repo →
file/route a finding, never inline-fix), route-cross-repo (a different repo, allowed ONLY
when crossRepoPolicy: authorized), or refuse-cross-repo (a different repo under the
default forbidden policy → REFUSE). The block is opt-in + backward-compatible: absent it,
every candidate resolves in-boundary. A present-but-malformed boundary is fail-closed
(exit 2). It composes with repo-binding-preflight.sh (which guards the agent-source install
binding); the boundary guards the per-task ALLOWED SCOPE. Unrelated same-repo findings are
filed/routed; different-repo findings are route-only unless the user authorized a cross-repo
scenario.
Outcome vocabulary (canonical)
State-modifying and diagnostic agents MUST end with EXACTLY ONE of these four outcomes (per agents/bubbles_shared/validation-core.md and evidence-rules.md; enforced by bubbles/scripts/audit-result-contract-lint.sh):
| Outcome | When to use |
|---|---|
completed_owned |
A state-modifying agent finished its owned work: all owned DoD items [x] with evidence, no unresolved findings, all gates pass |
completed_diagnostic |
A read-only/analysis agent (audit, review, regression, security, …) finished its diagnostic pass: findings packaged for owners, no owned DoD to check |
route_required |
Found work that belongs to another specialist; package it as a finding with nextRequiredOwner. This is an upward return to the active top-level runner, which performs the next dispatch. You MUST NOT dispatch that owner yourself: a subagent on this runtime has no dispatch tool at all, so the call would not fail loudly, it would silently do nothing and tempt you to do the work inline and record it as a delegation. |
blocked |
Cannot proceed; external dependency, missing input, or mechanical gate refuses |
done_with_concerns is legacy read-only compatibility only (pre-G092 specs carrying legacyStatusCompatibility:true); it is not a valid new RESULT-ENVELOPE outcome. To ship non-blocking notes, validate certifies done with an observations[] array (severity low/medium), or a diagnostic agent surfaces observation-shaped findings (followUpOwner/followUpAction) for the orchestrator to attach — see completion-governance.md. Anything warranting high severity is blocked, not a concern.
Finding accounting (NON-NEGOTIABLE)
Every finding raised in this invocation MUST appear in EXACTLY ONE of:
addressedFindings(fixed in this scope, evidence linked)unresolvedFindings(routed to owner)observations[](non-blockinglow/mediumnotes attached tocompleted_ownedor a validate-certifieddone, per completion-governance.md — never used to launder a gate failure)
A finding that disappears between rounds is the cherry-pick anti-pattern and is blocked by the workflow agent's post-fix-cycle verification.
Learning disposition (mutable runs)
Closing an envelope after a run that CHANGED something is the moment to answer
one question: did this run teach anything worth keeping? Record the answer in the
optional learning object. There are exactly three legal answers.
disposition |
Means | Also required |
|---|---|---|
captured |
A lesson was written | lessonId naming it |
not-applicable |
The run produced nothing generalizable | nothing |
deferred |
A lesson is owed but was not written now | reason, 20+ characters |
"learning": { "disposition": "captured", "lessonId": "lesson-9f2c1a" }
Write the lesson with bubbles.sh lessons add --problem … --root-cause … --fix … --applies-when …, which returns the id and compacts the file.
This is not a quota. execution-ops.md argues that forcing one lesson per run
manufactures filler and degrades clustering, and that argument is preserved
intact. not-applicable is a legitimate, common, and unquestioned answer. What
is recorded is that the decision was MADE — an agent that decided correctly used
to leave no trace of having decided at all.
result-envelope-validate.sh refuses only what it can falsify: captured with
no resolvable lessonId, and deferred with a reason shorter than twenty
characters. Omitting the whole object stays valid.
Common mistakes
- Claiming
completed_ownedwhile leaving unchecked DoD items — guard rejects this. - A diagnostic agent emitting
completed_owned— read-only/analysis agents own no DoD; they emitcompleted_diagnostic. - Emitting
done_with_concernsas a current outcome — it is legacy-read-only; usecompleted_owned/completed_diagnosticwithobservations[]for non-blocking notes, orblockedfor anything a gate would refuse. Never use an observation to dodge a fixable bug. - Setting
nextRequiredOwnertobubbles.workflow— workflow is the dispatcher, not the next owner. Name the actual specialist. - Using
@bubbles.Xin envelope or output — the slash convention applies everywhere:/bubbles.Xonly. - Claiming
learning.disposition: capturedwithout writing the lesson — the validator refuses it in every mode, including--advisory.
Workflow-only continuation (NON-NEGOTIABLE)
Read-only/advisory surfaces (recap, status, handoff, super, retro, recommend-first) MUST suggest /bubbles.workflow <mode> for continuation, not /bubbles.implement, /bubbles.test, /bubbles.validate, or /bubbles.audit directly. Direct specialist commands are valid only when the user explicitly requests a surgical invocation.
Authoritative modules
agents/bubbles_shared/workflow-orchestration-core.md— envelope schema + dispatcher contractagents/bubbles_shared/workflow-delegation-core.md— natural-language intent routingagents/bubbles_shared/workflow-execution-loops.md— per-round synchronous completionagents/bubbles_shared/workflow-fix-cycle-protocol.md— finding-set closure during remediationagents/bubbles_shared/agent-common.md— Workflow-Only Continuation section
04 同仓库更多 Skills
smackerel-trace-capture
Wire Smackerel's concrete validate-plane stack into the framework trace-driven defect-discovery method. Use when running live-category tests (integration/e2e/e2e-ui/stress) against the ephemeral test stack; capturing SLO or trace evidence; hunting latency/error/perf bugs from spans; querying the test-stack Jaeger or Prometheus; or touching `.specify/runtime/observability`. Concrete smackerel endpoints + the exact `capture-slo.sh` command; do NOT duplicate `bubbles-observability-adapter` — this only adds the wiring.
smackerel-no-defaults
Enforce Smackerel's NO-DEFAULTS / fail-loud SST policy. Use when editing config, Docker Compose, deploy adapters, docs, instructions, skills, env handling, host bind addresses, or any runtime value that could be hidden by fallback syntax.
bubbles-workflow-mode-resolution
Resolve a Bubbles workflow mode against `bubbles/workflows.yaml`, including template inheritance, status ceilings, gate wiring, and decision policy. Use when picking a mode for a request, when a guard reports a mode-related failure, or when extending workflows.yaml with a new mode or template. Covers natural-language intent routing and the workflow registry consistency rules.
bubbles-workflow-execution-loops
Run per-round synchronous workflow execution loops correctly. Use when orchestrating a multi-round workflow, dispatching specialist subagents, handling round-based remediation, or interpreting a workflow mode's execution policy. Covers authorized direct execution, dispatch-and-wait, batch-then-summarize prohibition, and mapped-mode execution.
bubbles-vscode-agent-constraints
Design agents that fit the VS Code Copilot Chat runtime instead of fighting it. Use when authoring or editing any `*.agent.md`; when adding `tools:`, `agents:`, `handoffs:`, `model:`, `user-invocable:`, or `disable-model-invocation:` frontmatter; when designing an orchestrator that dispatches specialists; when a design implies agent-calls-agent-calls-agent chaining; when a subagent dispatch silently no-ops or an agent cannot be selected in the dropdown; or when writing a governance rule about delegation that the runtime cannot actually enforce. Prevents multi-level-subagent designs, prose-only dispatch laws, and frontmatter/body contradictions.
bubbles-upkeep-cadence
How to schedule, dispatch, and record recurring operational upkeep tasks (backup, restore-drill, BCDR-drill, patch-cycle, secret-rotation, flag-cleanup, compliance-sweep). Use when authoring or modifying `config/upkeep-calendar.yaml`, when investigating a missed task, when reading the upkeep ledger, or when adding a new task type.