Skip to content

feat(issue-body-contract): add the issue-body contract and generate the org issue forms from it - #986

Merged
kyle-sexton merged 4 commits into
mainfrom
feat/issue-body-contract
Nov 11, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
feat/issue-body-contract

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: owner-approved design (org issue and PR template interview, Q34 and Q36-Q38, 2026-11-11)

Summary

Adds one issue-body contract, components/issue-body-contract/contract.json, holding per issue type (bug, feature, task, agent-ready work item) the fields, headings, required flags, floor labels and native issue type. The org issue forms are generated from it, and the sync delivers the forms plus the contract to melodic-software/.github and the contract to the bugs and work-items plugins, so every surface that writes or checks an issue body reads one record.

It also restores the community profile's "Issue templates" check. The live community page shows "Not added yet" for issue templates on all 11 public org repositories, .github included, although .github holds the forms itself. Across 12 public repositories compared on 2026-11-11, the check failed exactly where every form sets a top-level type: key (ours since #22 in .github, commit 5d5509a) and passed wherever at least one form omits type: or a Markdown template exists. The new agent-ready form sets no native type: triage picks Bug, Feature or Task. The generator refuses a contract where every type sets one.

Fix

  • contract.json: the record. The bug form follows /bugs:write's five fields (steps, expected, actual, severity with justification, suggested fix location). The task form follows /work-items:track add's default headings (Context, Proposed work, Acceptance criteria, References). The agent-ready form follows the agent-brief fields. Every form applies only the needs-triage floor label; agent-ready stays a triage decision, never applied by a public form.
  • issue-forms.mjs generates forms/*.yml (write) and fails when the committed forms drift from the contract (check); issue-forms.test.mjs covers the generator and the contract rules. Both run in check-policies.
  • sync-manifest.yml: issue-forms (four forms and the contract) for melodic-software/.github; issue-body-contract-bugs and issue-body-contract-work-items for claude-code-plugins. Form file names are unchanged, so the sync PR updates in place and leaves no stale template; config.yml stays owned by .github.
  • The hosted managed-files guard lists the new destinations.

Admission evidence (component lifecycle):

  • Live consumers: melodic-software/.github .github/ISSUE_TEMPLATE/; claude-code-plugins /bugs:write and /work-items:track add, decompose, triage, whose follow-up PR reads the synced copies.
  • Owner and outcome: standards maintainers. Acceptance: the forms and both skills agree with the contract, and the community page for claude-code-plugins shows issue templates added. Rollback: revert this PR; the previous forms remain in .github history.
  • Delivery boundary: exact materialization, the same path as pr-body-contract-rule. Generation happens at authoring time, so the sync stays byte-exact with no transforms.
  • Alternatives: hand-maintained forms (the drift this replaces); fetching the contract at run time (network dependency for every skill run). No third-party dependency is added; the generator uses the repository's existing yaml dev dependency.
  • Rollout: deterministic check, blocking from admission; the committed forms are the generator's output, so the baseline is clean by construction.

Verification

  • npm run test:issue-forms: 8 tests pass.
  • npm run lint:issue-forms: committed forms match contract.json.
  • bash distribution/sync-manifest.sh validate: manifest valid, 53 components, 15 targets.
  • components/managed-files-guard/managed-files-guard.test.sh: passes with the new paths.
  • biome check and markdownlint-cli2 clean on the new files.

Related

  • Follow-ups: the .github PR adds the agent-ready form's local drift check and fixes the PR template's Refs # example to Refs: #; the claude-code-plugins PR points the skills at the synced contract.
  • Docs: About community profiles for public repositories; the REST files.issue_template field stays null for any ISSUE_TEMPLATE/ directory (github/rest-api-description#7187), so the live community page is the acceptance check.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe

kyle-sexton and others added 2 commits November 11, 2026 11:37
…he org issue forms from it

contract.json is the one record of each issue type's fields, headings,
required flags, floor labels and native type. issue-forms.mjs generates
the org forms from it; CI fails when the committed forms drift. The sync
materializes the forms and the contract into melodic-software/.github
and the contract into the bugs and work-items plugins.

The new agent-ready work-item form sets no native type, which also lets
the community profile count the org issue templates again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
…labels to the floor

The contract now holds the body shape /work-items:decompose publishes as
a type with no form, so decompose reads its headings from the same
record. A form's labels must equal the floor labels exactly, so no form
can apply a role label. Severity justification is required, as
/bugs:write requires it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 11, 2026 16:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T16:46:02.740518Z 4127e03 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4127e037b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

kyle-sexton and others added 2 commits November 11, 2026 11:49
The issue-tracker playbook said every form and every filing sets the
Issue Type. The agent-ready work-item form sets none, and triage picks
it, so the three passages now name that exception and link the
issue-body contract that records why.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe
@github-actions

Copy link
Copy Markdown

claude-security-review reviewed de099da465390505f3738d1661420e8cebea5316: 0 finding(s), 0 as inline comments.

No security findings in this pull request. The PR touches 13 files, and I read all of them. The review followed the CI security-review criteria.

critical-findings: 0

  • Workflow (.github/workflows/pr-require-checks.yml): two steps are added, npm run test:issue-forms and npm run lint:issue-forms. They sit beside existing npm run lint:* steps. The workflow triggers on pull_request, not pull_request_target. No permissions:, trigger, if: or secret handling changed, and no ${{ }} expression goes into a run: block. The workflow's trigger and permissions blocks are unchanged.
  • Generator (components/issue-body-contract/issue-forms.mjs):
    • It reads only the repo's own contract.json and writes only to forms/<name> under its own directory.
    • Form names must match ^[a-z0-9-]+\.yml$, which blocks path traversal.
    • It takes no external input, no shell, no network and no eval.
    • Output goes through the pinned yaml dependency (package.json, yaml 2.9.1) with no user-controlled templating.
  • Contract and forms: the generator refuses any public form whose labels differ from the needs-triage floor. This keeps the agent-ready role label out of public forms, and a test covers it. The generated form YAML matches that rule.
  • Trust controls: none are widened. The edits to managed-files-guard.yml only add the new synced issue-form and contract paths to the guarded set. That narrows what can change unreviewed. distribution/sync-manifest.yml adds components and target entries that copy files byte-exact. It adds no token scope, trusted actor, kill-switch change or hold change.
  • Plugin manifests and instruction surfaces: no plugin.json or marketplace.json changes. No standing instruction was deleted or softened. The standards/process/issue-tracker.md and README changes are additive documentation.
  • PR body contract: that rule is untouched.

Not consulted: the instruction exception register, because no instruction was removed or narrowed.

@github-actions

Copy link
Copy Markdown

claude-review reviewed de099da465390505f3738d1661420e8cebea5316: 0 finding(s), 0 as inline comments.

Code review: no findings

I read the full diff (13 files), the PR context, and the pr-body-contract rule. Nothing met the high-signal bar, so I posted no inline comments.

What I checked, by reading the code:

  • issue-forms.mjs. validateContract, renderForm, renderAll and diffForms are consistent with each other. The "at least one form without a native type" refusal, the floor-label equality check for form-bearing types, and the null-form skip all match what the README and the PR body say they do.
  • Committed forms. forms/*.yml match what the generator would produce from contract.json. I compared names, types, labels, field order, required flags, placeholder rendering and the header by eye. I did not regenerate them.
  • Tests. Each test exercises the rule it names. Some of them call the validator on a mutated clone, so they would fail if the rule were dropped.
  • Sync and guard. issue-forms is added to the melodic-software/.github target, and the two plugin copies to the claude-code-plugins target. The managed-files guard path list gains exactly the new destinations, in sorted position.
  • Docs. The README anchor #rules-the-contract-keeps used in standards/process/issue-tracker.md matches its heading.
  • PR body contract. The PR opens with No related issue: <reason>. No body line starts with committer.

Unverified: the sandbox denied node --test, issue-forms.mjs check and sync-manifest.sh validate, so I ran none of them. The PR body says they pass; that is author-claimed here, not something I confirmed.

Closing issue: none. The PR states "No related issue", so there are no acceptance criteria to check.

Observation, not counted: headingLevels and emptyAnswer in contract.json are not covered by validateContract. Nothing in this PR reads them yet. The README says they are for future body checks, so a malformed value would not fail CI until a consumer exists.

No manifest changes, no hold class, no settled-thread or prior-findings files.

@kyle-sexton
kyle-sexton merged commit 817897d into main Nov 11, 2026
22 checks passed
@kyle-sexton
kyle-sexton deleted the feat/issue-body-contract branch November 11, 2026 20:05
kyle-sexton added a commit to melodic-software/.github that referenced this pull request Nov 11, 2026
No related issue: owner-approved design (org issue and PR template
interview, Q34 and Q36-Q38, 2026-11-11)

## Summary

The org issue forms are now generated in `melodic-software/standards`
from the issue-body contract and synced here with the contract beside
them (#237). This adds the local drift check the design called for, and
fixes the PR template's `Refs` example to the `Refs: #<issue>` form the
PR body contract names.

## Fix

- `.github/scripts/issue-form-drift.mjs` and its tests: compare each
form in `.github/ISSUE_TEMPLATE/` to
`.github/standards/issue-body-contract/contract.json` (name, native
type, labels, and each field's id, kind, heading and required flag);
report a form the contract does not declare and a declared form that is
missing; skip `config.yml` and contract types with no form. Local files
only, no network.
- `pr-require-checks.yml`: new `check-issue-forms` job running the tests
then the check. Advisory, like `check-pr-sections`: not in `ci-status`
`needs:`.
- `.github/PULL_REQUEST_TEMPLATE.md`: the Related example reads `Refs:
#<issue-number>`.
- `README.md`: the templates entry names the generated forms and where
to change them, and the CI entry names the new lane.

## Verification

- `node --test .github/scripts/issue-form-drift.test.mjs`: 7 pass.
- `node .github/scripts/issue-form-drift.mjs` on this branch (main
merged in, with #237's forms): `4 forms match
.github/standards/issue-body-contract/contract.json`.
- `node --test .github/scripts/pr-section-drift.test.mjs`: 27 pass.
- Live community page, 4:29 PM EST: "Issue templates" now shows added on
`claude-code-plugins`, `.github`, `standards` and `cursor-plugins` (it
read "Not added yet" on all 11 public repos before #237).

## Related

- melodic-software/standards#986 (the contract
and generator)
- #237 (the sync that
delivered the forms)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton added a commit that referenced this pull request Nov 11, 2026
#988)

No related issue: follow-up to
#986 (owner-approved
issue-body contract design)

## Summary

#986 synced the issue-body contract into two plugin directories of
`claude-code-plugins`. Its sync PR,
melodic-software/claude-code-plugins#15429,
cannot pass: `scripts/check-cross-plugin-source-drift.sh` refuses a file
byte-identical across two plugins unless the same change registers it,
and a registry entry cannot land first because the check also refuses an
entry with fewer than two copies (STALE BASELINE). A sync PR cannot
carry that registration.

## Fix

- `sync-manifest.yml`: `issue-body-contract-bugs` and
`issue-body-contract-work-items` become one component,
`issue-body-contract-plugins`, delivering `contract.json` to
`docs/contracts/issue-body/contract.json` in `claude-code-plugins`. That
repository's `sync-shared-copies.sh` fans the canonical into each
plugin's `reference/`, registered in the same change, as it already does
for `docs/contracts/standards/README.md`.
- The hosted managed-files guard lists the new destination instead of
the two plugin paths.
- The component README names the new path.

## Verification

- `bash distribution/sync-manifest.sh validate`: valid, 52 components,
15 targets.
- `components/managed-files-guard/managed-files-guard.test.sh`: passes.
- In a `claude-code-plugins` checkout, a registry entry for
`reference/issue-body-contract.json` without the copies fails
`check-cross-plugin-source-drift.sh --check` with STALE BASELINE (exit
1), which rules out registering first.

## Related

- #986
- melodic-software/claude-code-plugins#15429
(the sync PR this push refreshes)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01VQb9Q2ceZLXhTR4d1vkTCe

Co-authored-by: Claude Opus 5.5 <[email protected]>
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