Skip to content

New-feature tickets: task tags, earlier attempts, reuse, registrations, staging content, checklist, open questions - #340

Merged
nambok merged 1 commit into
mainfrom
feat/new-feature-discipline
Oct 28, 2026
Merged

nambok merged 1 commit into
mainfrom
feat/new-feature-discipline

Conversation

@nambok

@nambok nambok commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

New-feature tickets now get the same care a careful engineer gives them, for every team, and the rules are enforced in code wherever that's possible. In a real run, a feature re-planned because its new files didn't exist yet. Other runs repeated work from earlier attempts, wrote helpers that already existed, missed a registration that a sibling had, left staging content out of date for the end-to-end tests, and raised product questions only in chat. This PR adds eight rules. The planner is told about them, the plan's own check sends a plan back once when it misses one, and a gate checks them before the pull request opens.

Changes

Rule 1: new files are expected (worker/passes/feature/plan_files.rs, validate_plan)

  • Each task in tasks.md now names its action after the colon: - [ ] path: [create|modify|delete|replace] .... A tag before the path is also read.
  • Only modify, delete and replace paths have to exist. A create path must not already exist; if it does, the plan has to say replace.
  • A tagged path that breaks either rule sends the plan back with a note that lists each one. If it still breaks a rule, the run stops. Untagged tasks keep the old reading of their words and the old 30% threshold.
  • The format is compatible with the plan_coverage parser in Plan check before the PR; fix rounds get their own budget, push once, and never fail an open PR; generated files are regenerated #331. A [create] description still counts as new there, and (optional) / optional: still count as optional.

Rule 2: earlier attempts (feature/prior.rs)

  • Before planning, the run looks for earlier work: pull requests and branches that name the ticket or a ticket its text names (a parent or related key), pull requests with a similar title, and branches with a similar name that have no pull request. Open PRs are left out, because the existing open-PR handling covers them.
  • Each attempt's commits are read along with their files. Merges, and commits that share no ticket key, title word or file with the attempt's own work, are marked as unrelated.
  • The planner gets one entry per attempt: what it did, why it ended, the files it touched, and its unrelated commits ("do not carry it over"). design.md must contain ## Differences from earlier attempts and name each attempt. Where an attempt and the ticket differ, the ticket wins.
  • In code: the base is never an attempt's branch (fresh_base). Before the PR, a branch that changes files only unrelated commits touched, and that no task names, gets a fix round. If the files are still there after it, the PR is blocked.

Rules 3 and 4: reuse, and mirror the closest sibling (feature/reuse.rs)

  • A feature plan lists ## Reuse (paths, or what it searched) and, when it creates files, ## Closest sibling with a path. If either is missing, the plan is sent back once.
  • Before the PR, new exports (TS/JS, Rust, Python, Go) are compared with existing exports that have similar names, found by code search. A model judges each pair, and only pairs it was asked about count. Duplicates get a fix round, and any that remain are flagged in the description.

Rule 5: registration completeness (feature/registration.rs)

  • Each new file or folder item has siblings: the same extension in the same folder, or the folders beside a new folder.
  • A file counts as a registration place when it names most of the sampled siblings (all of them if there are 3 or fewer, otherwise at least 60%). A page that only uses two of them is not a registration place.
  • On the branch, every registration place must name the new item, in any case style. A feature that still misses one after a fix round is blocked, and the list is given. For other runs, the missing places are flagged in the description.

Rule 6: content-dependent tests (feature/content.rs, common::staging_cms, gateway/routes/staging_cms.rs)

  • The rule applies when a catch-all route reads a CMS, the repo has end-to-end specs, and the diff changes a CMS schema. From the diff it lists dropped fields, newly required fields (with their initialValue), and new block types that a changed spec names.
  • New optional per-repo setting: a staging CMS write connection (Sanity today). Its token is sealed with KMS and bound to the team, the repo and its purpose, and it is never returned.
  • Production is refused when the connection is saved and again before every write. A dataset is refused if any word of its name is production, prod, prd, live, master or main, if it is the production dataset the team named, or if the repo's .env*prod* files name it.
  • With the connection, the run makes only changes that don't invent content: it unsets dropped fields and fills missing required fields with their default. Everything else, or every change when there is no connection, blocks the PR with the exact list.
  • The description always has a ## Staging content section that says what was changed on staging, or that nothing was.

Rule 7: verification checklist (feature/checklist.rs)

  • Built from the repo and the ticket:
    • type-check, lint and unit tests, using the root's own scripts
    • unit test cases, one per case the acceptance criteria list (counted from the ticket, or from the plan's scenarios)
    • the e2e spec, and its entry in each test map
    • checks for test packages outside the workspace (test_package)
    • the new spec run --repeat-each=5 against the team's test address
    • for UI work, a scrollWidth check at 480px or narrower and at 1280px or wider
  • The sandbox runs the commands the team's agent permissions allow. Counts and results go into the PR's ## Verification checklist.
  • A failing item gets a fix round. If it still fails, the PR stays a draft: feature::ready_hold is wired into mark_pr_ready and the CI ready path, and re-reads the PR head each time.

Rule 8: open product questions (feature/questions.rs)

  • These are decisions the ticket doesn't settle and the change doesn't need. They go under ## Open product questions in design.md, or in a coder note line that starts with Open product question:. The PR lists them as undecided, and current behaviour is kept. Blocking questions still use CLARIFICATION_NEEDED.

Hooks (kept small, away from #331's hunks)

  • passes/mod.rs:
    • gather the attempts before planning
    • task tags in validate_plan
    • one feature::gate call before pr::run, for single-repo runs only; multi-repo passes None
  • plan.rs:
    • the planner block
    • the task format
    • feature::plan_gaps added to the existing one-time send-back
  • Other files:
    • pr.rs: Proof.feature, the description sections, registration for the ready check
    • ticket_history.rs: a prior field, and read_pr is now pub(crate)
    • github.rs: list_branches and commit_files
    • gateway: the route, plus three handlers under the repos capability

Verification

…, registrations, staging content, checklist and open questions
@nambok
nambok merged commit 9e46322 into main Oct 28, 2026
8 checks passed
@nambok
nambok deleted the feat/new-feature-discipline branch October 28, 2026 01:01
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