Skip to content

feat: point agents at permission-safe sibling-repo evidence - #881

Merged
jflowers merged 1 commit into
unbound-force:mainfrom
jflowers:quick/sibling-evidence-agent-guidance
Oct 31, 2026
Merged

jflowers merged 1 commit into
unbound-force:mainfrom
jflowers:quick/sibling-evidence-agent-guidance

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

Point agents at declared, in-repo, permission-safe sibling-repo
resources after a deployed /uf.unleash pipeline wedged 26 minutes
on an out-of-workspace sibling read (parented child sessions cannot
answer permission asks).

  • Guidance (three surfaces): new MUST rule FA-005 in the content
    convention pack (consult .uf/sibling-repos.yaml, use
    acquire_sibling_evidence or the in-workspace
    .uf/sibling-clones/<name>/ and .uf/sibling-cache/<name>/
    copies; never read sibling repos from outside-workspace paths);
    sibling-reference research steps in speckit.specify,
    speckit.plan, opsx-propose, and uf.run-pipeline-plan; a new
    "Sibling Repositories" section in AGENTS.md plus
    ensureAGENTSmdSiblingSection in uf init so deployed repos get
    the section idempotently (stealth-gated, 9 new tests).
  • Hardening: uf_delegate_command threads child_session_id
    into DELEGATE_FAILED / DELEGATE_CANCELLED envelopes (typed on
    ToolFailure, 4 new test assertions) so wedged or failed child
    sessions are diagnosable directly from the delegation result.
  • All scaffold mirrors updated byte-identical; retrospective
    learnings recorded under .uf/dewey/.

Quick tier (quick/sibling-evidence-agent-guidance); review council
reached APPROVE WITH ADVISORIES on iteration 3.

How to Test

Guidance surfaces:

rg -n "sibling" .opencode/uf/packs/content.md   # FA-005 rule
rg -n "Sibling Repositor" AGENTS.md
rg -n "sibling" .opencode/commands/speckit.specify.md .opencode/commands/speckit.plan.md .opencode/commands/opsx-propose.md .opencode/commands/uf.run-pipeline-plan.md

Envelope hardening + type contract:

rg -n "child_session_id" .opencode/plugins/uf-workflow/index.ts .opencode/lib/uf-workflow-types.ts

Scaffold section (idempotent append, stealth-gated):

rg -n "ensureAGENTSmdSiblingSection" internal/scaffold/scaffold.go

Mirror parity (byte-identical pairs):

diff .opencode/uf/packs/content.md internal/scaffold/assets/opencode/uf/packs/content.md
diff .opencode/plugins/uf-workflow/index.ts internal/scaffold/assets/opencode/plugins/uf-workflow/index.ts
diff .opencode/lib/uf-workflow-types.ts internal/scaffold/assets/opencode/lib/uf-workflow-types.ts
diff .opencode/commands/uf.run-pipeline-plan.md internal/scaffold/assets/opencode/commands/uf.run-pipeline-plan.md

Gates:

make lint && make build
make coverage-gate
make plugin-test
go test -race -count=1 ./internal/scaffold/ -run TestEnsureAGENTSmdSiblingSection

How to Demo

Show the FA-005 rule and the three guidance surfaces, run the
scaffold idempotency tests, and diff a scaffold mirror pair against
its source to show byte-identical parity (commands above).

Key Files Changed

  • internal/scaffold/scaffold.go (+88) — ensureAGENTSmdSiblingSection
  • internal/scaffold/scaffold_test.go (+346) — 9 new tests
  • .opencode/uf/packs/content.md (+14) — FA-005 MUST rule
  • .opencode/plugins/uf-workflow/index.ts (+19/-5) — child_session_id in failure envelopes
  • .opencode/lib/uf-workflow-types.ts (+7) — ToolFailure.child_session_id
  • .opencode/commands/{speckit.specify,speckit.plan,opsx-propose,uf.run-pipeline-plan}.md — sibling-reference research steps
  • AGENTS.md (+13) — Sibling Repositories section
  • CHANGELOG.md (+25) — change entry
  • 15 retrospective learnings under .uf/dewey/learnings/
  • Scaffold mirrors under internal/scaffold/assets/ (byte-identical)

Known Issues

  • 6 LOW informational advisories from /uf.review-council (iteration
    3, APPROVE WITH ADVISORIES) — no code changes required.
  • make check: TestRunInit_FreshDir file-count assertion fails
    (PRE-EXISTING — reproduces identically on a stashed clean tree);
    DevPod CoverageSmoke attach failure (ENVIRONMENTAL — passes on
    re-run). Both classified in the quick pre-flight inventory.

This PR was generated by /uf.finale (AI-assisted).

A deployed /uf.unleash pipeline wedged 26 minutes on an
out-of-workspace sibling read because parented child sessions
cannot answer permission asks. Teach agents to use declared,
in-repo sibling resources instead.

- Add MUST rule FA-005 to the content convention pack: consult
  .uf/sibling-repos.yaml, use acquire_sibling_evidence or the
  in-repo .uf/sibling-clones/<name>/ and .uf/sibling-cache/<name>/
  copies, and never read sibling repos from outside-workspace paths
- Add "Sibling repository references" research steps to
  speckit.specify, speckit.plan, opsx-propose, and
  uf.run-pipeline-plan
- Add a "Sibling Repositories" section to AGENTS.md and a new
  uf init behavior (ensureAGENTSmdSiblingSection) that appends
  the same section to deployed repos' AGENTS.md when
  .uf/sibling-repos.yaml exists (stealth-gated, nine new tests)
- Thread child_session_id into uf_delegate_command
  DELEGATE_FAILED / DELEGATE_CANCELLED envelopes so failed
  delegations name their child session for direct forensics
- Mirror all changed assets in internal/scaffold with drift
  tests; record retrospective learnings under .uf/dewey

Assisted-by: glm-5
Generated with AI assistance (glm-5)
@jflowers
jflowers requested a review from a team as a code owner October 30, 2026 23:16
@jflowers jflowers self-assigned this Oct 30, 2026

@jflowers jflowers left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Council: APPROVE WITH ADVISORIES

Verdict: APPROVE WITH ADVISORIES — no blocking findings.
Findings: 12 (3 MEDIUM, 9 LOW), all non-blocking advisories.
Council: 4 Divisor agents (architect, curator, guard, testing) all returned APPROVE WITH ADVISORIES; the adversary run failed with an environmental server error on its model route and did not vote. CI security scans (OSV-Scanner, Trivy, Scorecards, Gitleaks) all pass, and no executed run produced a security finding.
Dispatch provenance: correlation ed879662-2251-49b4-adaa-a07aa7ab2702, 5-reviewer plan (4 personas skipped: envoy/herald/scribe content-capability, sre scope-miss).

MEDIUM advisories

# Category Location Persona
1 scaffold-idempotency internal/scaffold/scaffold.go:1713 architect
2 coverage-gap .opencode/plugins/uf-workflow/index.ts:2241 testing
3 documentation-dry .opencode/commands/speckit.plan.md:65 architect

LOW advisories

# Category Location Persona
4 dry internal/scaffold/scaffold.go:1687 architect
5 documentation-pipeline CHANGELOG.md:30 curator
6 cross-component-value internal/scaffold/scaffold.go:1715 guard
7 regression-protection internal/scaffold/scaffold_test.go:8014 testing
8 content-accuracy .uf/dewey/learnings/agent-wedge-20261030T212253-jay-flowers.md:10 curator
9 documentation-consistency .opencode/commands/uf.run-pipeline-plan.md:136 guard
10 contract-consistency .opencode/lib/uf-workflow-types.ts:31 testing
11 documentation-consistency .opencode/uf/packs/content.md:221 curator
12 factual-consistency CHANGELOG.md:11 guard

All 12 findings are posted as inline comments with evidence and recommendations.

Strengths

  • Scaffold mirrors are byte-identical — git blob-hash pairs in the diff prove parity for all four mirrored assets.
  • ensureAGENTSmdSiblingSection carries a complete nine-test matrix: skip paths, idempotency, read/write failures, newline synthesis, and stealth gating.
  • child_session_id threading is locked by a full code × presence matrix driven through the real executor with injected fakes.
  • CI is fully green across build, lint, plugin tests, pipeline tests, coverage gates, CRAP analysis, and security scans.

This review was generated by /uf.review-pr (AI-assisted).

}

if strings.Contains(string(existing), agentsmdSiblingMarker) {
return subToolResult{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] scaffold-idempotency · divisor-architect

This return site suppresses the append on any pre-existing ## Sibling Repositories heading, including user-authored sections with unrelated content. The dewey sibling repo's AGENTS.md ships a same-named org-repos table today, so uf init in that repo reports already configured and skips the UF permission-safety guidance — on the highest-affinity targets for this section. The probe is heading-only (strings.Contains on agentsmdSiblingMarker); spec 030's two-signal pattern (heading plus a semantic content phrase) is not adopted here.

Recommend probing for a UF-specific phrase inside the section (e.g. acquire_sibling_evidence) or emitting a distinct action string for heading-present-but-content-differs so operators can distinguish suppression from prior deployment.

: `delegated run ended with status "${result.status}"`,
{ retryable: result.error?.retryable ?? false, code },
),
result.childSessionID !== undefined

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] coverage-gap · divisor-testing

The child_session_id threading at this site covers only the DELEGATE_FAILED / DELEGATE_CANCELLED envelope. The tool's other failure paths — EXPECTED_ARTIFACT_MISSING (~line 2256) and DELEGATE_ERROR (~line 2316) — return without the field even though childSessionID is in scope and the ToolFailure doc comment describes the field as covering delegation failures where the executor created a child session. No test locks presence or omission for those two codes, so a regression there compiles and passes.

Recommend threading the field at both sites and extending the code × presence matrix (the fake-client pattern in unleash-delegate.test.ts) to cover them.

with standard research.

2. **Extract unknowns from Technical Context** above:
2. **Sibling repository references**: Before filesystem or

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] documentation-dry · divisor-architect

This step restates the sibling-reference guidance that now lives on nine surfaces (four command files, FA-005, AGENTS.md, the Go scaffold literal, and the scaffold mirror), with three phrasings of the failure-mode tail clause across the copies: "wedge parented child sessions" (opsx-propose, uf.run-pipeline-plan), "parented child sessions cannot answer" (speckit.*, AGENTS.md, scaffold literal), and FA-005's combined form. Nothing binds the copies to the canonical rule — non-uf command files have no scaffold mirrors, so a future edit to FA-005 leaves these steps silently stale.

Recommend a scoped pointer ("per FA-005 in the content convention pack") or verbatim alignment with the canonical rule text.

// pure existence check, not a content read.
// Uses opts.ReadFile/WriteFile for testability (dependency injection).
func ensureAGENTSmdSiblingSection(opts *Options) subToolResult {
siblingPath := filepath.Join(opts.TargetDir, ".uf", "sibling-repos.yaml")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] dry · divisor-architect

ensureAGENTSmdSiblingSection duplicates the ~40-line structural skeleton of ensureAGENTSmdPackSection — os.Stat existence probe, ReadFile with IsNotExist branch, heading-marker idempotency check, trailing-newline synthesis, WriteFile with failure detail — differing only in names, marker, and section body. This second copy sits at the CS-004 duplication threshold; a third append function would cross it.

Recommend a shared appendAGENTSmdSection(opts, name, marker, body) helper with both callers supplying their specifics.

Comment thread CHANGELOG.md
`uf_delegate_command` DELEGATE_FAILED / DELEGATE_CANCELLED
envelopes (declared on `ToolFailure`, omitted when no child
session existed) so failed delegations name their child
session for direct forensics. (Docs-issue exemption:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] documentation-pipeline · divisor-curator

The deferred in-repo docs, website, and tutorial issues carry a verified human deferral record — who (jflowers), where (review-council curation gate), when (2026-10-30), and exactly which issues were deferred — so the documentation gate is satisfied per the gatekeeping framework. This comment is a scope note, not a gap.

If the deferral is revisited, the filing scope is: a docs issue for the AGENTS.md sibling section and FA-005 guidance, a unbound-force/website issue for the workflow change, and a tutorial opportunity covering permission-safe sibling evidence.

tier: draft
---

Parented child sessions in OpenCode cannot answer permission asks, so any tool call that triggers a permission "ask" (e.g., reading a file outside the workspace) wedges the child until its timeout fires. Root cause verified on reading-stone (2026-10-30): agents following convention-pack rules FA-003/FA-004 read sibling repositories at out-of-workspace paths (~/Projects/github/unbound-force/<sibling>), hung the delegated uf.unleash child for 30 minutes, and returned only DELEGATE_FAILED with no pointer to the wedged session. Fix pattern (shipped as quick/sibling-evidence-agent-guidance in unbound-force): (1) point agents at declared sibling resources in-workspace — .uf/sibling-repos.yaml, the acquire_sibling_evidence tool (origin-verified, commit-pinned), .uf/sibling-clones/<name>/ and .uf/sibling-cache/<name>/ — via a convention-pack rule (FA-005) plus research steps in the specify/plan/pipeline commands and an AGENTS.md "Sibling Repositories" section; (2) thread child_session_id into DELEGATE_FAILED/DELEGATE_CANCELLED envelopes so a wedged child is diagnosable instead of opaque. When a delegated child times out with DELEGATE_FAILED, check child_session_id and inspect the child session before assuming the work never ran — the reading-stone child had completed all edits before its timeout fired.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] content-accuracy · divisor-curator

This learning records the wedge as 30 minutes ("hung the delegated uf.unleash child for 30 minutes") while the CHANGELOG entry and the PR description say 26 minutes. One of the two numbers is wrong; FA-002 requires numerical consistency across surfaces.

Recommend reconciling to the session-log value and updating both surfaces.

reads trigger permission asks that wedge parented child
sessions (see Direct Human Gate Surfacing).

### Plan File Contract

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] documentation-consistency · divisor-guard

The sibling-reference paragraph above this heading carries a third phrasing variant of the failure-mode clause ("wedge parented child sessions (see Direct Human Gate Surfacing)"), alongside "parented child sessions cannot answer" in the speckit.* copies and FA-005's combined form. No drift binding exists for non-uf command files.

Recommend aligning the failure-mode clause across copies or scoping each copy to a pointer at FA-005.

* created a child session before failing. Omitted when no
* child session ever existed.
*/
readonly child_session_id?: string

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] contract-consistency · divisor-testing

ToolFailure.child_session_id encodes absence as an optional field (omitted, per the doc comment) while the executor-side result that feeds it encodes absence as an explicit nullable value — two absence encodings across one tool's contract. Consumers branching on the field must handle both shapes.

Recommend one canonical absence encoding for the wire contract (optional-omitted is the JSON-idiomatic choice) and stating it in the doc comment.

file access to confirm exact numbers, flags, and
capabilities before writing.

- **FA-005** [MUST] For cross-repo reference material

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] documentation-consistency · divisor-curator

FA-005 is the canonical statement of the sibling-reference rule, but its failure-mode clause combines two phrasings that appear separately across the command-file copies — so no copy matches the canonical text verbatim. Future edits to the rule will not grep-match the copies.

Recommend either aligning all copies verbatim to FA-005 or converting the copies to scoped pointers, and listing the governed surfaces in FA-005.

Comment thread CHANGELOG.md
### Added
- sibling-evidence-agent-guidance: Pointed agents at declared,
in-repo, permission-safe sibling-repo resources after a
deployed /uf.unleash pipeline wedged 26 minutes on an

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] factual-consistency · divisor-guard

This line records the wedge as 26 minutes; the retrospective learning (agent-wedge-20261030T212253) records 30 minutes for the same incident. FA-002 requires numerical consistency across surfaces.

Recommend reconciling to the session-log value and updating both this entry and the learning.

@jflowers
jflowers merged commit e98da33 into unbound-force:main Oct 31, 2026
17 checks passed
jflowers added a commit to jflowers/unbound-force that referenced this pull request Nov 2, 2026
…kflows

180 Dewey learnings produced during the bulk /uf.triage-issue runs
over unbound-force/gaze (2026-11-01/02) and adjacent workflow
sessions were left untracked on main, blocking /uf.unleash tier
routing (the DIRTY_TREE guard counts untracked files). This
commits them per repo precedent (3abf946 / PR unbound-force#897, 08f51e0 /
PR unbound-force#881, chore/dewey-learnings-20261030).

Dominant topics: issue-triage (129), documentation-gate (12),
review-dispatch (5), opencode-v2-migration (4), plus assorted
spec-governance, seam-verification, scaffold-*, gh-cli,
determinism, change-records, and bug-patterns learnings.
jflowers added a commit that referenced this pull request Nov 2, 2026
…kflows

180 Dewey learnings produced during the bulk /uf.triage-issue runs
over unbound-force/gaze (2026-11-01/02) and adjacent workflow
sessions were left untracked on main, blocking /uf.unleash tier
routing (the DIRTY_TREE guard counts untracked files). This
commits them per repo precedent (3abf946 / PR #897, 08f51e0 /
PR #881, chore/dewey-learnings-20261030).

Dominant topics: issue-triage (129), documentation-gate (12),
review-dispatch (5), opencode-v2-migration (4), plus assorted
spec-governance, seam-verification, scaffold-*, gh-cli,
determinism, change-records, and bug-patterns learnings.
@jflowers
jflowers deleted the quick/sibling-evidence-agent-guidance branch November 15, 2026 21:38
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