Skip to content

docs(#553): add ADR 0076 for slash command entity-context separation - #5685

Merged
ascerra merged 7 commits into
mainfrom
agent/553-adr-slash-command-context
Aug 6, 2026
Merged

docs(#553): add ADR 0076 for slash command entity-context separation#5685
ascerra merged 7 commits into
mainfrom
agent/553-adr-slash-command-context

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Adds ADR 0076 formalizing the slash command entity-context separation: /fs-code dispatches only from issue contexts, /fs-fix and /fs-review dispatch only from PR contexts. This records the design decision implemented in #533, documenting the rationale (each agent consumes context-specific inputs), the current enforcement mechanism (ISSUE_HAS_PR guards in dispatch routing), and the target state (CEL trigger expressions per ADR 0061).

Changes

  • New docs/ADRs/0076-slash-command-entity-context-separation.md — Accepted ADR covering the entity-context constraint, a per-command allowed-context table, and the three enforcement layers (GitHub Actions, Go router, CEL triggers)
  • Updated docs/architecture.md — Added entity-context separation reference under the Slash-command parser + ACL building block (§2)

Testing

  • make lint-md-links passes — all markdown links resolve
  • Secret scan passes on all changed files
  • Gitlint passes on commit message
  • ADR frontmatter validated (status matches body, no leading zeros in title number)

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • I wrote this contribution myself and can explain all changes in it

Closes #553

Post-script verification

  • Branch is not main/master (agent/553-adr-slash-command-context)
  • Secret scan passed (gitleaks — b4fd4ae8b290e94e2a8c22918621146e28e92182..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Record the design decision that /fs-code triggers only from
issue contexts and /fs-fix and /fs-review trigger only from PR
contexts. Each agent consumes inputs specific to its entity
context — running in the wrong context is a category error.

The ADR documents the current GitHub Actions enforcement
(ISSUE_HAS_PR guards), notes the Go router gap, and identifies
CEL trigger expressions (ADR 0061) as the target enforcement
mechanism.

Updates docs/architecture.md to reference the new ADR under
the Slash-command parser + ACL building block.

Closes #553
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 28, 2026 17:02
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Jul 28, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 28, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 5:04 PM UTC · Completed 5:17 PM UTC
Commit: 92b15c6 · View workflow run →

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

Site preview

Preview: https://678aac16-site.fullsend-ai.workers.dev

Commit: 9a34711729e942a7261eb99ffc37f9be78215aa1

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review

Findings

Medium

  • [incomplete-entity-context-restriction] docs/agents/code.md:33 — The command documentation states "/fs-code can only be used on issues (not PRs)" but ADR 0076 (added in this PR) specifies that /fs-code dispatches only from "Issue without an associated PR." The current phrasing does not capture the additional restriction that /fs-code should not work on issues that already have a linked PR.
    Remediation: Update to clarify the entity-context restriction, e.g., "It can only be used on issues that do not have an associated PR."

Low

  • [incomplete-entity-context-restriction] docs/guides/user/bugfix-workflow.md:62 — The slash commands table shows "/fs-code | Issue comment" without noting restriction to issues without associated PRs per ADR 0076.
    Remediation: Update the "Where" column for /fs-code to "Issue comment (no associated PR)" or add a note referencing ADR 0076.

  • [missing-cross-reference] docs/ADRs/0034-centralized-shim-routing-via-dispatch.md:110 — The note at lines 110-113 describes entity-context checking for review and fix triggers with a pending follow-up. ADR 0076 is that formalization — a cross-reference annotation would close the loop.
    Remediation: Add a minor annotation to the note referencing ADR 0076.

Previous run

Review

Findings

Low

  • [incomplete-update] docs/ADRs/0002-initial-fullsend-design.md:163 — The note at lines 163-166 describes entity-context checking for /fs-review as a per-repo mode implementation detail with a "pending follow-up". ADR 0076 (added in this PR) is that follow-up — a cross-reference annotation would close the loop. ADR 0076's Status section already says "Refines ADR 0002," so the linkage exists in one direction.
    Remediation: Add a minor annotation to the note referencing ADR 0076.

  • [inconsistent-terminology] docs/ADRs/0076-slash-command-entity-context-separation.md:65 — The command table uses "PR (issue with associated PR)" for /fs-fix and /fs-review, but "Issue without an associated PR" for /fs-code. The asymmetry is slightly confusing — the parenthetical conflates GitHub's implementation detail (PRs are issues) with the logical entity distinction this ADR formalizes.
    Remediation: Consider using consistent entity-type terminology throughout the table.

Previous run (2)

Review

Findings

Low

  • [technical accuracy] docs/ADRs/0076-slash-command-entity-context-separation.md:82 — The illustrative CEL trigger expression event.entity.kind == "work_item" && !has(event.state.change_proposal) uses state.change_proposal absence as a proxy for "issue without an associated PR". The normative schema enforces that when state.change_proposal is present on a work_item, entity.linked_change_proposal is required, but NOT the converse — linked_change_proposal can be present without state.change_proposal (which is demand-populated per the schema description). An adapter could emit a work_item with linked_change_proposal but without state.change_proposal, causing the expression to incorrectly match.
    Remediation: Change the example to event.entity.kind == "work_item" && !has(event.entity.linked_change_proposal).

  • [inconsistent-terminology] docs/agents/code.md:34 — The code agent documentation states /fs-code "can only be used on issues (not PRs)". ADR 0076 draws a finer distinction: "Issue without an associated PR". The doc's wording is less precise but not wrong. Not blocking; a follow-up could align terminology.

  • [inconsistent-terminology] docs/agents/review.md:28 — The review agent documentation states /fs-review triggers "on the PR (per-repo installs only; standalone issues are ignored)". ADR 0076 uses "PR (issue with associated PR)" — different terminology for the same constraint. Same follow-up opportunity.

Previous run (3)

Review

Findings

Low

  • [technical accuracy] docs/ADRs/0076-slash-command-entity-context-separation.md:49 — The ADR states the restriction was implemented as guards in "the dispatch routing script (reusable-dispatch.yml)" but ISSUE_HAS_PR does not appear in .github/workflows/reusable-dispatch.yml. The guards actually reside in the scaffolded per-repo dispatch template (internal/scaffold/fullsend-repo/.github/workflows/dispatch.yml). The next clause correctly identifies the location, making the parenthetical inaccurate.
    Remediation: Replace (reusable-dispatch.yml) with the actual file path or remove the parenthetical since the next clause already identifies the correct location.

  • [inconsistent-terminology] docs/agents/code.md:34 — The code agent documentation states /fs-code "can only be used on issues (not PRs)". ADR 0076 draws a finer distinction: "Issue without an associated PR". The doc's wording is less precise but not wrong — it describes where the command is typed rather than entity-context semantics. Not blocking; a follow-up could align terminology.

  • [inconsistent-terminology] docs/agents/review.md:28 — The review agent documentation states /fs-review triggers "on the PR (per-repo installs only; standalone issues are ignored)". ADR 0076 uses "PR (issue with associated PR)" — different terminology for the same constraint. Not blocking; same follow-up opportunity as above.


Labels: PR adds an ADR documenting slash command dispatch entity-context separation

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge component/docs User-facing documentation component/dispatch Workflow dispatch and triggers labels Jul 28, 2026
Replace the inaccurate reusable-dispatch.yml parenthetical with the
scaffold dispatch.yml path where ISSUE_HAS_PR guards actually live.

Signed-off-by: Adam Scerra <ascerra@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ascerra

ascerra commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Addressed the open review finding and re-checked ADR numbering:

  • Review fix: Corrected ADR 0076 Context so the ISSUE_HAS_PR guards point at internal/scaffold/fullsend-repo/.github/workflows/dispatch.yml instead of the inaccurate reusable-dispatch.yml parenthetical.
  • ADR number: Confirmed 0076 is still free on main and not claimed by other open PRs (main already has 0077/0078/0080/0081; in-flight numbers elsewhere do not include 0076), so no renumber was needed.
  • Pushed as cf5171d5.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 4, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 8:11 PM UTC · Ended 8:19 PM UTC
Commit: cf5171d · View workflow run →

Bring ADR 0076 branch up to date with main.
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 4, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 8:20 PM UTC · Ended 8:33 PM UTC
Commit: fa8f501 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 4, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:34 PM UTC · Completed 8:47 PM UTC
Commit: 748639d · View workflow run →

fullsend-ai-review[bot]

This comment was marked as outdated.

ascerra and others added 2 commits August 4, 2026 18:26
Use !has(event.entity.linked_change_proposal) instead of
state.change_proposal absence, which is not a reliable proxy.

Signed-off-by: Adam Scerra <ascerra@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 4, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:26 PM UTC · Completed 10:40 PM UTC
Commit: d9c35c8 · View workflow run →

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 6, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:20 AM UTC · Completed 11:38 AM UTC
Commit: 9a34711 · View workflow run →

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment and removed ready-for-merge All reviewers approved — ready to merge labels Aug 6, 2026
@ascerra
ascerra added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
@ascerra
ascerra added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 5a5ff65 Aug 6, 2026
22 checks passed
@ascerra
ascerra deleted the agent/553-adr-slash-command-context branch August 6, 2026 17:22
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 6, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 7:28 PM UTC · Completed 7:48 PM UTC
Commit: 9a34711 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #5685 — ADR 0076 slash command entity-context separation

Timeline

  1. Jul 28 — Issue #553 triaged, code agent created PR #5685 with ADR 0076 (2 files, +96/−1 lines). Code run 30380493991.
  2. Jul 28 — Review agent (run 30381117082) found two [low] findings: wrong file path reference (reusable-dispatch.yml → should be dispatch.yml) and inconsistent terminology. Verdict: APPROVED.
  3. Aug 4 — Human (ascerra) fixed the file path in cf5171d. Two review runs cancelled due to rapid successive pushes (concurrency group working correctly). Successful review (run 30948381604) found a wrong CEL expression field (event.state.change_proposal → should be event.entity.linked_change_proposal) at [low]. Verdict: APPROVED.
  4. Aug 4 — Human fixed the CEL expression in b26c1203. Review (run 30956394507) approved.
  5. Aug 6 — Final review (run 31096797609) found a [medium] incomplete-entity-context-restriction finding on docs/agents/code.md:33. Verdict: APPROVED. Human approved and merged.

What went well

  • Review caught real issues. The review agent identified two genuine factual inaccuracies — a wrong file path and a semantically incorrect CEL expression — that the human then fixed. These would have caused confusion for anyone referencing the ADR.
  • Code agent produced a solid initial ADR. The output was well-structured, correctly identified the design decision, and only needed minor factual corrections.
  • Concurrency groups worked correctly. Two stale reviews were cancelled when newer commits arrived, preventing wasted compute on outdated code.

Evidence for existing open issues

Review severity undergrading for docs factual inaccuracies (evidence for #5030): Both genuine findings (wrong file path, wrong CEL field) were graded [low] when they were factual inaccuracies in a normative ADR — the agent's own definition says approve requires "no medium+ findings." These findings describe behavior that would mislead a reader (someone searching for ISSUE_HAS_PR in reusable-dispatch.yml would fail; someone using the CEL expression as a reference would get incorrect match behavior). Under the docs-review skill's severity guidance, docs that are "incorrect and would mislead a reader" warrant [high]. The human treated both as worth fixing immediately.

APPROVED verdict with medium finding (evidence for #1453): The final review found a [medium] incomplete-entity-context-restriction finding on docs/agents/code.md:33 but still submitted APPROVED. The agent's own definition states approve is for "no medium+ findings" — this is a direct violation of its own verdict rules.

Code agent didn't verify file references in generated ADR (evidence for fullsend-ai/agents#461 and fullsend-ai/agents#387): The code agent referenced reusable-dispatch.yml when the ISSUE_HAS_PR guards actually live in internal/scaffold/fullsend-repo/.github/workflows/dispatch.yml, and used event.state.change_proposal instead of event.entity.linked_change_proposal in the CEL example. A grep for ISSUE_HAS_PR during generation would have revealed the correct file path.

Inline finding dedup across re-reviews (evidence for #5007): The inconsistent-terminology finding appeared in Reviews 1–4 but shifted target and framing each round (from code.md/review.md terminology to ADR table wording to code.md entity-context restriction). Without stable finding identifiers, the human couldn't distinguish what was new, what was a repeat, and what had been addressed.

Overall assessment

The workflow delivered a good outcome: a well-written ADR with factual corrections made before merge. The review agent's detection capability was strong — it caught errors the code agent introduced. The primary gap is severity calibration: both actionable findings were undergraded, and the verdict never escalated despite the agent's own rules requiring it. All improvement areas are well-tracked by existing open issues.

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

Labels

component/dispatch Workflow dispatch and triggers component/docs User-facing documentation ready-for-review Triggers review agent dispatch requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADR: formalize slash command context separation (/code on issues, /fix on PRs)

1 participant