docs: require complete targeted repair workflow

This commit is contained in:
sechmachine
2026-08-15 14:56:14 +07:00
parent 10196d55b0
commit 445e4fedeb
7 changed files with 41 additions and 0 deletions
+1
View File
@@ -121,6 +121,7 @@ For a multi-branch iteration:
- Use one worktree and one named owner/subagent per branch. Tell every owner that other agents share the repository and it must not revert others' work. - Use one worktree and one named owner/subagent per branch. Tell every owner that other agents share the repository and it must not revert others' work.
- Before starting assigned module work, every owner verifies its worktree is clean, fetches or uses the taskmaster-verified latest `main`, and fast-forwards its persistent branch to that exact main SHA. Do not build new work on a stale pre-integration branch, and do not use a merge that would rewrite or discard branch history. - Before starting assigned module work, every owner verifies its worktree is clean, fetches or uses the taskmaster-verified latest `main`, and fast-forwards its persistent branch to that exact main SHA. Do not build new work on a stale pre-integration branch, and do not use a merge that would rewrite or discard branch history.
- A targeted repair uses a clean, isolated `work/fix/<feature>/<what-fix>` branch and worktree from the taskmaster-verified current `main`. Do not use `work/<feature>/fix/<what-fix>`: the persistent `work/<feature>` ref already occupies that Git ref prefix. - A targeted repair uses a clean, isolated `work/fix/<feature>/<what-fix>` branch and worktree from the taskmaster-verified current `main`. Do not use `work/<feature>/fix/<what-fix>`: the persistent `work/<feature>` ref already occupies that Git ref prefix.
- Every targeted repair starts from the taskmaster-verified latest `main`, uses TDD RED → GREEN, adds Javadoc during implementation, records companion evidence, undergoes independent review, and uses a normal, non-force merge only when separately authorized.
- Establish and commit the platform foundation before dependent persistence work. - Establish and commit the platform foundation before dependent persistence work.
- Exchange only full immutable SHAs from clean worktrees; never merge a moving branch or ambiguous short SHA. - Exchange only full immutable SHAs from clean worktrees; never merge a moving branch or ambiguous short SHA.
- Preserve branch ownership. Request a producer-owned service/DTO boundary instead of reading its tables from a consumer. - Preserve branch ownership. Request a producer-owned service/DTO boundary instead of reading its tables from a consumer.
+2
View File
@@ -70,6 +70,8 @@ five persistent `work/<feature>` branches. Do not use
`work/<feature>/fix/<what-fix>` because the persistent `work/<feature>` ref `work/<feature>/fix/<what-fix>` because the persistent `work/<feature>` ref
already occupies that Git ref prefix. already occupies that Git ref prefix.
Every targeted repair starts from the taskmaster-verified latest `main`, uses TDD RED → GREEN, adds Javadoc during implementation, records companion evidence, undergoes independent review, and uses a normal, non-force merge only when separately authorized.
## 3. Start the development containers ## 3. Start the development containers
### PostgreSQL 18.4 ### PostgreSQL 18.4
+2
View File
@@ -132,6 +132,8 @@ taskmaster-verified current `main` named
`work/<feature>/fix/<what-fix>`: the persistent `work/<feature>` ref already `work/<feature>/fix/<what-fix>`: the persistent `work/<feature>` ref already
uses that Git ref prefix. uses that Git ref prefix.
Every targeted repair starts from the taskmaster-verified latest `main`, uses TDD RED → GREEN, adds Javadoc during implementation, records companion evidence, undergoes independent review, and uses a normal, non-force merge only when separately authorized.
Iteration 2 work must start from the merged Iteration 1 `main`, continue with Iteration 2 work must start from the merged Iteration 1 `main`, continue with
strict RED-to-GREEN TDD, add Javadoc during implementation, and update the strict RED-to-GREEN TDD, add Javadoc during implementation, and update the
matching Markdown evidence record before each milestone commit. matching Markdown evidence record before each milestone commit.
+2
View File
@@ -126,6 +126,8 @@ Run that check from the clean targeted-fix branch named
occupies that Git ref prefix. Record the expected RED and the matching GREEN occupies that Git ref prefix. Record the expected RED and the matching GREEN
shell output in the evidence record. shell output in the evidence record.
Every targeted repair starts from the taskmaster-verified latest `main`, uses TDD RED → GREEN, adds Javadoc during implementation, records companion evidence, undergoes independent review, and uses a normal, non-force merge only when separately authorized.
## 4. Useful commands ## 4. Useful commands
Run one test method: Run one test method:
@@ -14,6 +14,9 @@ feature-branch ownership areas.
`main`. `main`.
3. State why `work/<feature>/fix/<what-fix>` is invalid while its persistent 3. State why `work/<feature>/fix/<what-fix>` is invalid while its persistent
`work/<feature>` ref exists. `work/<feature>` ref exists.
Every targeted repair starts from the taskmaster-verified latest `main`, uses TDD RED → GREEN, adds Javadoc during implementation, records companion evidence, undergoes independent review, and uses a normal, non-force merge only when separately authorized.
4. Regenerate the local SRS after amending the existing operational requirement; 4. Regenerate the local SRS after amending the existing operational requirement;
do not add a requirement ID or a use case. do not add a requirement ID or a use case.
5. Prove GREEN with the executable six-guide regression that independently 5. Prove GREEN with the executable six-guide regression that independently
@@ -23,6 +23,8 @@ The forbidden form is `work/<feature>/fix/<what-fix>`. A repair owner preserves
other worktrees, records RED and GREEN evidence, commits locally, and does not other worktrees, records RED and GREEN evidence, commits locally, and does not
push or merge without separate authority. push or merge without separate authority.
Every targeted repair starts from the taskmaster-verified latest `main`, uses TDD RED → GREEN, adds Javadoc during implementation, records companion evidence, undergoes independent review, and uses a normal, non-force merge only when separately authorized.
## Consequences ## Consequences
- Persistent feature branches remain available for their iteration ownership. - Persistent feature branches remain available for their iteration ownership.
+29
View File
@@ -5,6 +5,15 @@ const path = require('node:path');
const repositoryRoot = path.resolve(__dirname, '..'); const repositoryRoot = path.resolve(__dirname, '..');
const validForm = '`work/fix/<feature>/<what-fix>`'; const validForm = '`work/fix/<feature>/<what-fix>`';
const invalidForm = '`work/<feature>/fix/<what-fix>`'; const invalidForm = '`work/<feature>/fix/<what-fix>`';
const requiredWorkflow = 'Every targeted repair starts from the taskmaster-verified latest `main`, uses TDD RED → GREEN, adds Javadoc during implementation, records companion evidence, undergoes independent review, and uses a normal, non-force merge only when separately authorized.';
const workflowElements = [
'taskmaster-verified latest `main`',
'TDD RED → GREEN',
'Javadoc during implementation',
'companion evidence',
'independent review',
'normal, non-force merge'
];
const documents = [ const documents = [
{ {
file: 'AGENTS.md', file: 'AGENTS.md',
@@ -40,6 +49,9 @@ function validate(contents) {
const content = contents.get(file); const content = contents.get(file);
if (count(content, validForm) !== 1) failures.push(`${file} must contain ${validForm} exactly once`); if (count(content, validForm) !== 1) failures.push(`${file} must contain ${validForm} exactly once`);
if (!content.includes(approved)) failures.push(`${file} is missing its approved branch workflow statement`); if (!content.includes(approved)) failures.push(`${file} is missing its approved branch workflow statement`);
if (count(content, requiredWorkflow) !== 1) {
failures.push(`${file} must contain the complete required targeted-repair workflow exactly once`);
}
const outsideApprovedStatement = content.replace(approved, ''); const outsideApprovedStatement = content.replace(approved, '');
if (outsideApprovedStatement.includes(validForm) || outsideApprovedStatement.includes(invalidForm)) { if (outsideApprovedStatement.includes(validForm) || outsideApprovedStatement.includes(invalidForm)) {
@@ -61,8 +73,24 @@ function readContents() {
const contents = readContents(); const contents = readContents();
validate(contents); validate(contents);
let workflowElementRejections = 0;
if (process.argv.includes('--self-test')) { if (process.argv.includes('--self-test')) {
for (const {file} of documents) { for (const {file} of documents) {
for (const workflowElement of workflowElements) {
const missingWorkflowElement = new Map(contents);
missingWorkflowElement.set(
file,
contents.get(file).replace(requiredWorkflow, requiredWorkflow.replace(workflowElement, ''))
);
assert.throws(
() => validate(missingWorkflowElement),
(error) => error instanceof Error
&& error.message.includes(`${file} must contain the complete required targeted-repair workflow exactly once`)
);
workflowElementRejections += 1;
}
const positiveRecommendation = new Map(contents); const positiveRecommendation = new Map(contents);
positiveRecommendation.set(file, `${contents.get(file)}\nUse ${invalidForm} for a targeted repair.\n`); positiveRecommendation.set(file, `${contents.get(file)}\nUse ${invalidForm} for a targeted repair.\n`);
assert.throws( assert.throws(
@@ -75,5 +103,6 @@ if (process.argv.includes('--self-test')) {
console.log(`Fix-branch workflow documentation: ${documents.length} approved statements validated`); console.log(`Fix-branch workflow documentation: ${documents.length} approved statements validated`);
if (process.argv.includes('--self-test')) { if (process.argv.includes('--self-test')) {
console.log(`Targeted-repair workflow element removals: ${workflowElementRejections}/${workflowElements.length * documents.length} rejected`);
console.log(`Positive nested branch recommendations: ${documents.length}/${documents.length} rejected`); console.log(`Positive nested branch recommendations: ${documents.length}/${documents.length} rejected`);
} }