Skip to content

feat(agents): the coding prompt names the title gate before the description is submitted - #1014

Merged
coreplane-switchboard[bot] merged 1 commit into
mainfrom
plan/2026-09-14-001-feat-title-gate-in-the-child-contract-plan/u2-the-coding-prompt-names
Sep 14, 2026
Merged

feat(agents): the coding prompt names the title gate before the description is submitted#1014
coreplane-switchboard[bot] merged 1 commit into
mainfrom
plan/2026-09-14-001-feat-title-gate-in-the-child-contract-plan/u2-the-coding-prompt-names

Conversation

@coreplane-switchboard

Copy link
Copy Markdown
Contributor

TL;DR

The coding preset's system prompt now tells every coding run to judge its PR title with the check:pr-title gate (npm run check:pr-title -- "<title>") before submitting the PR description. The gate's name is spelled through the PR_TITLE_GUARD constant exported by the contract module, so the prompt and the child contract can never say two different things.

What & why

Unit U2 of the plan docs/plans/2026-09-14-001-feat-title-gate-in-the-child-contract-plan.md. U1 made the child contract name check:pr-title among its guards; this unit makes the coding prompt itself instruct running the same gate before the description is submitted, importing the guard name from src/core/ship/contract.ts so a rename there flows into both places. Presets that open no pull request (review, research, explore, general) carry no such text.

Tour

1. One sentence in the shared PR-description guidance

The PR_DESCRIPTION_TEMPLATE — carried verbatim by both coding prompts (sandbox and resident) and by no other preset — now tells the run to judge its title with the gate before submitting, spelling the gate's name through the imported PR_TITLE_GUARD constant so one spelling serves the contract and the prompt.

Look for: The sentence names the constant-interpolated gate and the exact command npm run check:pr-title -- "<title>".

const PR_DESCRIPTION_TEMPLATE = `PR description — submit it with the submit_pr_description tool for EVERY PR (this is the default, not something to wait to be asked for). Switchboard renders the GitHub body from the object you submit, so never author PR-body markdown yourself. Before submitting, judge your title with the ${PR_TITLE_GUARD} gate — \`npm run check:pr-title -- "<title>"\` — and submit only a title it accepts; the same gate refuses the PR in CI. Content contract per field (each renders as its own section): prose is unwrapped — no hard line breaks inside a paragraph. Always hyperlink the triggering issue/request. Never fabricate validation — state exactly what you ran and the real result. Keep each field concise, not padded.

2. The import from the contract module

PR_TITLE_GUARD joins the contract headings the file already imports from src/core/ship/contract.ts — the pattern the unit names.

import { CONTRACT_HEADING, CONTRACT_SECTION_HEADINGS, PR_TITLE_GUARD } from "../core/ship/contract.js";

3. Tests: the gate is in the coding prompts and nowhere else

Both coding prompts must contain the gate's name and the command; the review, research, explore and general prompts must not carry the command. Red before the change (the first test failed), green after.

https://github.com/coreplanelabs/switchboard/blob/801a453f9cb980af8e3c1a473915013f5d78b2c5/src/agents/registry.test.ts#L796-L815

4. Remaining changes

  • none — every touched file is covered by a step above

Decisions

  • The sentence lives in PR_DESCRIPTION_TEMPLATE, not in each workflow list. The template is shared verbatim by both coding prompts and used by no other preset, so one sentence next to "submit it with the submit_pr_description tool" covers both prompt families without duplication — exactly where the unit asked it to sit.
  • The absence test checks the command string, not the guard name. The bare name check:pr-title legitimately appears in prompts that quote AGENTS.md's guard list; the command form npm run check:pr-title -- "<title>" is the instruction this unit adds, so absence is asserted on that.

Risks & implications

Minimal: a prompt-text-only change to the coding preset plus tests. No behavior, routing, or contract rendering changes; the constant import already existed as a pattern in the file.

Validation

Red-first test, then full verify green.

Criterion Proof
New test red before the change npx vitest run src/agents/registry.test.ts — 1 failed / 68 passed before editing registry.ts
Suite green after the change npx vitest run src/agents/registry.test.ts — 69 passed
Whole gate green npm run verify — VERIFY_GREEN (after npm ci fixed an unrelated pre-existing sandbox-pair dep drift in the resident environment)

🤖 Generated with Claude Code

@coreplane-switchboard coreplane-switchboard Bot 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.

LGTM: Small, correct change: coding prompt names the title gate via the contract's exported constant, with positive and negative prompt tests; spec coverage and test-guard clean.

Verdict: approve — no findings.

PR #1014 (head 801a453, 2 files, +23/−3 — fully covered by the diff I read):

  • src/agents/registry.ts imports PR_TITLE_GUARD from src/core/ship/contract.ts (confirmed exported there — U1 has merged) and adds one sentence to PR_DESCRIPTION_TEMPLATE telling coding runs to judge the title with the check:pr-title gate (npm run check:pr-title -- "<title>") before submitting. Since the template is interpolated into both the coding preset's system and residentSystem, one spelling serves both — matching the contract's goal that prompt and contract cannot drift.
  • src/agents/registry.test.ts adds the two test scenarios the unit contract lists: both coding prompts contain the gate name (via the constant) and the command; review, research, explore and general prompts (including resident variants) do not — exactly as specified.

Checks: specs:coverage — every changed path covered; test-guard ok — nothing removed; no spec contradictions (the touched specs' prompt behaviors are additive here). Contract: no spec rows named; both test scenarios present. The command string npm run check:pr-title -- "<title>" is a literal rather than derived from the constant, but the gate name rides the constant as the unit asked — not worth a finding.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto-approved: coreplane-switchboard[bot] reviewed this PR and posted an LGTM verdict (see its review). This repository opted in through its REVIEW_BOT_LOGIN and REVIEW_BOT_ID variables.

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.

0 participants