refactor: apply W1 state-root edits in W2/W3/W5-owned files; one moved-code touchfile golden for all workstreams

This commit is contained in:
garrytan committed 2026-09-30 06:44:24 +00:00
1 parent 97c98d7ee5
commit 7a50eb250e
19 files changed
+142 -131

No files matched your search

-64
View File
@@ -1,64 +0,0 @@
{
"recordedAt": "96764e80",
"note": "paid evals selected by touching each W1 source file, recorded on the base commit before the change",
"modules": {
"lib/state-root.ts": {
"sources": [
"browse/src/config.ts",
"lib/cso/state.ts"
],
"e2e": [
"aside-browse-basic",
"aside-browse-flow",
"benchmark-workflow",
"browse-basic",
"browse-snapshot",
"canary-workflow",
"carve-section-loading",
"cso-diff-mode",
"cso-full-audit",
"cso-infra-scope",
"design-review-detector-shim-dom",
"design-review-fix",
"diagram-authoring-quality",
"diagram-triplet",
"qa-b6-static",
"qa-b7-spa",
"qa-b8-checkout",
"qa-fix-loop",
"qa-only-no-fix",
"qa-quick"
],
"llmJudge": [
"browse/SKILL.md reference"
]
},
"bin/gstack-state-root.sh": {
"sources": [
"bin/gstack-paths",
"careful/bin/hook-extract.sh"
],
"e2e": [
"investigate-owned-abort",
"investigate-owned-completion",
"investigate-owned-ending-error",
"plan-design-with-ui-scope"
],
"llmJudge": []
},
"hosts/claude/hooks/hook-log.ts": {
"sources": [
"hosts/claude/hooks/question-log-hook.ts",
"hosts/claude/hooks/question-preference-hook.ts",
"hosts/claude/hooks/auq-error-fallback-hook.ts",
"hosts/claude/hooks/timeline-stop-hook.ts",
"hosts/claude/hooks/memorable-user-prompt-hook.ts"
],
"e2e": [
"auto-decide-preserved",
"docsync-spawned"
],
"llmJudge": []
}
}
}
+94
View File
@@ -0,0 +1,94 @@
{
"workstream": "W1 state-root owners",
"recordedAt": "96764e80",
"sources": {
"browse/src/config.ts": {
"e2e": [
"aside-browse-basic",
"aside-browse-flow",
"benchmark-workflow",
"browse-basic",
"browse-snapshot",
"canary-workflow",
"carve-section-loading",
"design-review-detector-shim-dom",
"design-review-fix",
"diagram-authoring-quality",
"diagram-triplet",
"qa-b6-static",
"qa-b7-spa",
"qa-b8-checkout",
"qa-fix-loop",
"qa-only-no-fix",
"qa-quick"
],
"llmJudge": [
"browse/SKILL.md reference"
]
},
"lib/cso/state.ts": {
"e2e": [
"cso-diff-mode",
"cso-full-audit",
"cso-infra-scope"
],
"llmJudge": []
},
"bin/gstack-paths": {
"e2e": [
"plan-design-with-ui-scope"
],
"llmJudge": []
},
"careful/bin/hook-extract.sh": {
"e2e": [
"investigate-owned-abort",
"investigate-owned-completion",
"investigate-owned-ending-error"
],
"llmJudge": []
},
"hosts/claude/hooks/question-log-hook.ts": {
"e2e": [],
"llmJudge": []
},
"hosts/claude/hooks/question-preference-hook.ts": {
"e2e": [
"auto-decide-preserved",
"docsync-spawned"
],
"llmJudge": []
},
"hosts/claude/hooks/auq-error-fallback-hook.ts": {
"e2e": [
"docsync-spawned"
],
"llmJudge": []
},
"hosts/claude/hooks/timeline-stop-hook.ts": {
"e2e": [],
"llmJudge": []
},
"hosts/claude/hooks/memorable-user-prompt-hook.ts": {
"e2e": [],
"llmJudge": []
}
},
"modules": {
"lib/state-root.ts": [
"browse/src/config.ts",
"lib/cso/state.ts"
],
"bin/gstack-state-root.sh": [
"bin/gstack-paths",
"careful/bin/hook-extract.sh"
],
"hosts/claude/hooks/hook-log.ts": [
"hosts/claude/hooks/question-log-hook.ts",
"hosts/claude/hooks/question-preference-hook.ts",
"hosts/claude/hooks/auq-error-fallback-hook.ts",
"hosts/claude/hooks/timeline-stop-hook.ts",
"hosts/claude/hooks/memorable-user-prompt-hook.ts"
]
}
}
+1 -4
View File
@@ -8,8 +8,5 @@
{ "path": "bin/gstack-state-root.sh", "match": "*", "reason": "the bash owner of the chain" },
{ "path": "careful/bin/check-careful.sh", "match": "_GSTACK_HOME_DIR=\"${GSTACK_HOME:-$HOME/.gstack}\"", "reason": "partial-upgrade fallback, reached only when an older hook-extract.sh lacks gstack_hook_state_root (legacy order kept on purpose)" },
{ "path": "gstack-upgrade/SKILL.md.tmpl", "match": "elif [ -d \"$HOME/.gstack/repos/gstack/.git\" ]; then", "reason": "the relocated gstack checkout is an install location, not state" },
{ "path": "gstack-upgrade/SKILL.md.tmpl", "match": "INSTALL_DIR=\"$HOME/.gstack/repos/gstack\"", "reason": "the relocated gstack checkout is an install location, not state" },
{ "path": "scripts/resolvers/review.ts", "match": "*", "reason": "PENDING CROSS-OWNER (W5): delete this entry once the W1 handoff's review.ts / new-module edits are applied" },
{ "path": "scripts/resolvers/design.ts", "match": "*", "reason": "PENDING CROSS-OWNER (W5): delete this entry once the W1 handoff's design.ts edits are applied" },
{ "path": "scripts/test-free-shards.ts", "match": "*", "reason": "PENDING CROSS-OWNER (W2): delete this entry once the W1 handoff's test-free-shards.ts edit is applied" }
{ "path": "gstack-upgrade/SKILL.md.tmpl", "match": "INSTALL_DIR=\"$HOME/.gstack/repos/gstack\"", "reason": "the relocated gstack checkout is an install location, not state" }
]
@@ -1,35 +0,0 @@
/**
* Touchfile coverage for W1's new modules: touching lib/state-root.ts,
* bin/gstack-state-root.sh or hosts/claude/hooks/hook-log.ts must select at
* least the paid evals their source files selected on the base commit
* (test/fixtures/state-root-selection-golden.json, recorded before the move).
*/
import { describe, test, expect } from 'bun:test';
import * as fs from 'fs';
import * as path from 'path';
import { E2E_TOUCHFILES, LLM_JUDGE_TOUCHFILES, GLOBAL_TOUCHFILES, selectTests } from './helpers/touchfiles';
import { resolveStateRoot } from '../lib/state-root';
const ROOT = path.resolve(import.meta.dir, '..');
const GOLDEN = 'test/fixtures/state-root-selection-golden.json';
const golden: { modules: Record<string, { sources: string[]; e2e: string[]; llmJudge: string[] }> } =
JSON.parse(fs.readFileSync(path.join(ROOT, GOLDEN), 'utf-8'));
describe('W1 touchfile superset', () => {
test('the golden covers every new state-root module', () => {
expect(Object.keys(golden.modules).sort()).toEqual(['bin/gstack-state-root.sh', 'hosts/claude/hooks/hook-log.ts', 'lib/state-root.ts']);
expect(typeof resolveStateRoot).toBe('function');
});
for (const [mod, rec] of Object.entries(golden.modules)) {
test(`touching ${mod} selects a superset of ${rec.sources.join(', ')}`, () => {
const e2e = new Set(selectTests([mod], E2E_TOUCHFILES, GLOBAL_TOUCHFILES).selected);
const llm = new Set(selectTests([mod], LLM_JUDGE_TOUCHFILES, GLOBAL_TOUCHFILES).selected);
const missing = [...rec.e2e.filter((t) => !e2e.has(t)), ...rec.llmJudge.filter((t) => !llm.has(t))];
expect(missing, [
`${mod} selects fewer paid evals than its source files did: ${missing.join(', ')}`,
`Fix: add ${mod} to those entries in test/helpers/touchfiles-data.ts (golden: ${GOLDEN}).`,
].join('\n')).toEqual([]);
});
}
});