Skip to content

Phase 21: polish write-mode smoke docs + guardrail UX#20

Merged
keithah merged 8 commits intomainfrom
gsd/phase-21-polish
Feb 11, 2026
Merged

Phase 21: polish write-mode smoke docs + guardrail UX#20
keithah merged 8 commits intomainfrom
gsd/phase-21-polish

Conversation

@keithah
Copy link
Copy Markdown
Member

@keithah keithah commented Feb 11, 2026

This rolls up Phase 21 polish:

  • Document xbmc/xbmc end-to-end write-mode smoke steps and how to grep evidence bundle logs by deliveryId.
  • Improve write-mode refusal UX with rule/file/detector context (denyPaths/allowPaths/secretScan), including on the same-repo PR-branch update path.
  • Make @kodiai review / @kodiai recheck retrigger review via UI reviewer request without adding PR-thread comments.
  • Increase default execution timeout from 300s to 600s to reduce large-repo timeouts.

Verification:

  • bun test
  • bunx tsc --noEmit

Document xbmc/xbmc write-mode smoke steps and evidence grepping, and capture Phase 21 plan artifacts/state.
Enrich write-policy errors with rule/path/detector context, include that detail in refusal replies, make rereview commands request the UI team without posting comments, and raise the default execution timeout for large repos.
Copilot AI review requested due to automatic review settings February 11, 2026 00:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Phase 21 polish rollup improving write-mode UX/guardrails, adding ops docs for xbmc/xbmc smoke testing + log grepping, introducing a non-chatty rereview trigger, and increasing default execution timeouts to reduce large-repo failures.

Changes:

  • Enrich write-policy refusals with rule/path/pattern/detector context and ensure same-repo PR-branch update path surfaces refusals cleanly.
  • Add minimal @kodiai review / @kodiai recheck rereview trigger via UI reviewer request (no PR-thread comments).
  • Increase default execution timeout to 600s and update timeout guidance to reference timeoutSeconds; make CI typecheck blocking; add smoke/runbook docs.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/lib/sanitizer.test.ts Adjusts expectations to satisfy stricter TS indexing checks.
src/lib/errors.ts Updates timeout suggestion text to reference timeoutSeconds.
src/jobs/workspace.ts Adds structured metadata to WritePolicyError and improves guardrail error context (pattern/detector/path).
src/handlers/mention.ts Implements rereview command via reviewer request; improves write-policy refusal replies (including PR-head update path).
src/handlers/mention.test.ts Adds/refines tests for refusal detail fields and rereview behavior.
src/execution/executor.ts Raises runtime default timeout to 600s (used if config load fails).
src/execution/config.ts Raises config default timeoutSeconds to 600s.
docs/smoke/xbmc-xbmc-write-flow.md Adds end-to-end write-mode smoke procedure for xbmc/xbmc.
docs/runbooks/mentions.md Adds runbook snippet for grepping evidence bundle logs by deliveryId.
.planning/phases/21-polish/21-01-PLAN.md Adds plan doc for Phase 21 plan 01.
.planning/phases/21-polish/21-01-SUMMARY.md Adds summary for Phase 21 plan 01.
.planning/phases/21-polish/21-02-PLAN.md Adds plan doc for Phase 21 plan 02.
.planning/phases/21-polish/21-02-SUMMARY.md Adds summary for Phase 21 plan 02.
.planning/phases/21-polish/21-03-PLAN.md Adds plan doc for Phase 21 plan 03.
.planning/phases/21-polish/21-03-SUMMARY.md Adds summary for Phase 21 plan 03.
.planning/phases/21-polish/21-04-PLAN.md Adds plan doc for Phase 21 plan 04.
.planning/phases/21-polish/21-04-SUMMARY.md Adds summary for Phase 21 plan 04.
.planning/STATE.md Updates planning state to Phase 21 progress.
.github/workflows/ci.yml Makes typecheck step blocking by removing continue-on-error.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/jobs/workspace.ts
Comment on lines 271 to 280
try {
denyMatchers = compileGlobMatchers(denyPaths);
allowMatchers = compileGlobMatchers(allowPaths);
} catch (err) {
const message = err instanceof Error ? err.message : String(err);
throw new WritePolicyError(
"write-policy-not-allowed",
`Write blocked: invalid path policy pattern: ${message}`,
{ rule: "allowPaths" },
);
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The invalid-glob catch block always sets meta.rule to "allowPaths", but the failure could be caused by a denyPaths pattern as well. This can mislead users when troubleshooting (the message will point at the wrong rule family). Consider compiling/validating denyPaths and allowPaths separately so you can attribute the error to the correct rule (or include both).

Copilot uses AI. Check for mistakes.
Comment thread src/handlers/mention.ts Outdated
Comment on lines +1129 to +1134
lines.push(` - '${err.path}'`);
lines.push("```");

if (allowPaths.length > 0) {
lines.push("");
lines.push(`Current allowPaths: ${allowPaths.map((p) => `'${p}'`).join(", ")}`);
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The refusal message prints a YAML snippet using single quotes around err.path and allowPaths entries. Git paths can legally contain a single quote, which would make the suggested YAML invalid. Consider escaping single quotes for YAML single-quoted scalars (e.g., replace ' with '') or using a safer quoting strategy when interpolating paths/patterns into the snippet.

Suggested change
lines.push(` - '${err.path}'`);
lines.push("```");
if (allowPaths.length > 0) {
lines.push("");
lines.push(`Current allowPaths: ${allowPaths.map((p) => `'${p}'`).join(", ")}`);
const escapedPath = err.path.replace(/'/g, "''");
lines.push(` - '${escapedPath}'`);
lines.push("```");
if (allowPaths.length > 0) {
lines.push("");
lines.push(
`Current allowPaths: ${allowPaths
.map((p) => `'${p.replace(/'/g, "''")}'`)
.join(", ")}`
);

Copilot uses AI. Check for mistakes.
Comment thread src/handlers/mention.test.ts Outdated
});

describe("createMentionHandler rereview command", () => {
test("@kodiai review posts minimal reply and requests aireview team", async () => {
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

This test name says it "posts minimal reply", but the test setup explicitly throws if createReplyForReviewComment is called (i.e., it expects no PR-thread comment). Rename the test to reflect the actual behavior (requesting reviewers without posting a comment) to avoid confusion.

Suggested change
test("@kodiai review posts minimal reply and requests aireview team", async () => {
test("@kodiai review requests aireview team without posting a reply comment", async () => {

Copilot uses AI. Check for mistakes.
Comment thread docs/smoke/xbmc-xbmc-write-flow.md Outdated
Comment on lines +35 to +37
- `evidenceType=write-mode`
- `outcome=updated-pr-branch|created-pr|reused-pr|skipped-idempotent`
- `deliveryId=<X-GitHub-Delivery>`
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The evidence-bundle log field is emitted as a structured JSON key deliveryId (see logger.info calls in handlers), not as a deliveryId=<...> string. Using deliveryId=<X-GitHub-Delivery> here may mislead grep/query guidance; consider aligning with the actual field/key format used in logs (e.g., deliveryId: <...> / deliveryId key).

Suggested change
- `evidenceType=write-mode`
- `outcome=updated-pr-branch|created-pr|reused-pr|skipped-idempotent`
- `deliveryId=<X-GitHub-Delivery>`
- `"evidenceType": "write-mode"`
- `"outcome": "updated-pr-branch|created-pr|reused-pr|skipped-idempotent"`
- `"deliveryId": "<X-GitHub-Delivery>"`

Copilot uses AI. Check for mistakes.
Split path-policy glob validation by rule family, escape YAML suggestions safely, align smoke docs with structured log fields, and clarify rereview test name.
@keithah keithah requested a review from a team February 11, 2026 01:19
@keithah
Copy link
Copy Markdown
Member Author

keithah commented Feb 11, 2026

@kodiai recheck

@kodiai
Copy link
Copy Markdown

kodiai Bot commented Feb 11, 2026

kodiai response

Decision: NOT APPROVED

Issues:

  • (1) [minor] src/handlers/review.ts (49): Duplicate comment line. The text "to enable UI-only re-review without a comment." appears on both lines 48 and 49.

@keithah
Copy link
Copy Markdown
Member Author

keithah commented Feb 11, 2026

@kodiai recheck

@kodiai
Copy link
Copy Markdown

kodiai Bot commented Feb 11, 2026

kodiai response

Decision: NOT APPROVED

Issues:

  • (1) [major] src/handlers/mention.ts (179, 209): Unnecessary octokit instance re-acquisition in postMentionReply() and postMentionError(). Both functions call githubApp.getInstallationOctokit(event.installationId) instead of reusing the already-acquired octokit instance from line 176. This causes redundant API calls and potential inconsistency.
  • (2) [minor] src/handlers/mention.ts (589): Silent failure in rereview command. When config.review.uiRereviewTeam is empty after trim, the function returns without posting any feedback to the user, leaving them unaware their @kodiai review or @kodiai recheck command was ignored.

Reuse the existing installation Octokit for replies/errors/reactions to avoid redundant client creation. Ensure rereview commands always attempt the default aireview team when uiRereviewTeam is unset/blank.
@keithah
Copy link
Copy Markdown
Member Author

keithah commented Feb 11, 2026

@kodiai recheck

@kodiai
Copy link
Copy Markdown

kodiai Bot commented Feb 11, 2026

kodiai response

Decision: APPROVE

Issues: none

@keithah keithah merged commit 3633cea into main Feb 11, 2026
1 check passed
@keithah keithah deleted the gsd/phase-21-polish branch February 11, 2026 01: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.

2 participants