T-44OO-plugin-scripts-self-discover-project-root
Status: closed/obsoleted · Impact: high · Complexity: medium
Plugin scripts under plugin/scripts/ currently rely on callers (skills, operators) to pass
--config, --baseline-dir, --project-root, and similar path flags. Worktrees ship a tracked
.sdlc/skill-ext/ directory which makes <worktree>/.sdlc/ look like a project root to any naive
walk-up discovery — but real project state (.sdlc/runtime/, .sdlc/quality-baselines/) lives ONLY
in the main worktree’s .sdlc/. Callers that forget the right flag get silent fallbacks:
bun run run_quality_checks.ts --diff-against-baseline exits 0 with no gate when the baseline-dir
lookup misses; bun run quality_baseline.ts capture writes baselines to a worktree’s .sdlc/ where
the gate will never find them. Every Rust-flavoured task on consumer projects has silently lost the
drift gate this way. The structural fix: scripts self-discover project root from cwd via
git rev-parse --git-common-dir (or equivalent), independent of which worktree the script was
invoked from. Callers stop passing paths; scripts stop silently misbehaving. This is the same shape
the lease library landed in T-FRTD-drop-lease-filesystem-cache.
| Location | Role today |
|---|---|
plugin/scripts/run_quality_checks.ts | Accepts --config <path> and --baseline-dir <path>. Defaults --baseline-dir to <project-root>/.sdlc/quality-baselines/ where <project-root> is whatever the caller passed via --project-root. From a worktree cwd, the default lands on <worktree>/.sdlc/quality-baselines/ (empty, gitignored) and the gate silently falls through to “baseline not found, ignoring.” |
plugin/scripts/quality_baseline.ts | Same shape: takes --config and --baseline-dir. Writes baselines to whichever path the caller supplied. From a worktree, lands in the worktree’s .sdlc/ where nothing reads them later. |
plugin/skills/task-work/SKILL.md (Step 3a, Step 7, Step 9) | Compensates by explicitly passing --baseline-dir <main-repo>/.sdlc/quality-baselines (when the operator remembers — which we don’t, every time). |
plugin/scripts/migrate_entities.py | Takes --project-root. Less critical because it operates on docs/planning/, which is identical in worktree and main. |
plugin/scripts/sdlc_lease.ts | Already self-discovers (post-T-FRTD-drop-lease-filesystem-cache). Exemplar of the target shape. |
plugin/scripts/lease_heartbeat_loop.ts | Also self-discovers (post-cache-drop). |
plugin/lib/lease/runtime.ts#findProjectRoot | Public helper for git-common-dir-based project-root resolution. Currently only used by the lease library; could be promoted to a shared helper. |
plugin/scripts/status_dashboard.ts | Mirrors _find_project_root walk inline (per the earlier layering-violation survey). Should consume the shared helper. |
Proposed
Section titled “Proposed”Plugin scripts under plugin/scripts/ accept only operational arguments (verb-specific things like
SHAs, task IDs, file paths to operate on). They DO NOT take --config, --baseline-dir, or
--project-root as required arguments. Internally, each script resolves project root from cwd via a
shared helper, then derives sdlc.yaml and any other paths from there.
The resolution rule (encoding what the lease library already does):
- Run
git rev-parse --git-common-dirin cwd. The output is the path to the shared.gitdirectory. - The parent of that directory is the main worktree — the canonical project root.
- From there,
sdlc.yamlis<project-root>/sdlc.yaml; baselines are<project-root>/.sdlc/quality-baselines/; runtime is<project-root>/.sdlc/runtime/; etc.
Optional escape hatch: --project-root <path> can be passed by callers that want to override
discovery. The default is self-discovery. The escape hatch exists for tests and adversarial cases;
production callers never use it.
Optional verification: callers can pass --project-id <id> (matched against sdlc.yaml’s
project_id: field if present) so the script can assert “the discovered project root is the one I
expected” — useful for catching cross-project mistakes. Out of scope unless we already have a
project-id concept; check during implementation and add only if cheap.
The shared helper lives at plugin/lib/sdlc_paths/ (or similar) — a new tiny library that exposes
find_project_root(start=None) -> Path. The lease library’s find_project_root is moved or
re-exported from there. Scripts import the helper instead of rolling their own walk.
Critically: callers (skills, operators) no longer need to remember --baseline-dir or --config.
The skill prose in task-work Step 3a, Step 7, Step 9 simplifies to bare
bun run quality_baseline.ts capture <sha> and
bun run run_quality_checks.ts --diff-against-baseline <sha>.
Approach
Section titled “Approach”- Audit current state. Survey every script under
plugin/scripts/for--config,--baseline-dir,--project-root,--entities-dir, or any path-resolution flag that callers currently pass. Note which are required vs optional. - Decide where the shared helper lives. Options: extract from
plugin/lib/lease/runtime.ts#findProjectRootinto a newplugin/lib/sdlc_paths/package, or keep it inlease/and re-export. Pick the option that creates the least churn in existing imports. - Build / promote
find_project_rootwith thegit common-dir-based discovery (current lease implementation already does this — verify before reusing). - Refactor
run_quality_checks.tsto callfind_project_root()at entry and derive--config--baseline-dirdefaults from it. Keep flags as optional overrides; remove them from required-args.
- Refactor
quality_baseline.tsto the same shape. - Refactor any other script the audit in step 1 surfaced. Status-dashboard’s inline walk is a natural target.
- Simplify skill prose. Remove
--baseline-dir/--config/--project-rootfrom the example invocations inplugin/skills/task-work/SKILL.md(Step 3a, Step 7, Step 9). Note in the prose that the script discovers project root automatically. - Tests. Add unit tests for the shared
find_project_roothelper covering: invoked from main worktree, invoked from a linked worktree, invoked from a subdirectory of either, invoked outside any git repo (clean error). - Project-id verification (optional, only if cheap). If a
project_id:field exists insdlc.yaml(check the schema), add--project-idas an optional override-check across the refactored scripts. If no such field exists today, skip. - Run end-to-end. Confirm a
/sdlc:task-work → /sdlc:task-close-outcycle works without any path-related flags passed manually. AC-5 below pins this.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/lib/sdlc_paths/ | new | Shared helper package exposing find_project_root and friends. Or extend plugin/lib/lease/ instead — decided during implementation. |
plugin/lib/lease/runtime.ts | modify | If the helper moves, drop the lease library’s copy and import from the shared module. |
plugin/scripts/run_quality_checks.ts | modify | Self-discover project root; --config and --baseline-dir become optional overrides. |
plugin/scripts/quality_baseline.ts | modify | Same. |
plugin/scripts/status_dashboard.ts | modify | Replace inline _find_project_root walk with the shared helper. |
plugin/skills/task-work/SKILL.md | modify | Step 3a, Step 7, Step 9 prose drops the explicit --baseline-dir/--config flags from the example invocations. |
plugin/lib/sdlc_paths/tests/ | new | Unit tests for the shared helper. |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: A new shared helper at
plugin/lib/sdlc_paths/(orplugin/lib/lease/re-export) exposesfind_project_root(start=None) -> Pathand usesgit rev-parse --git-common-dirfor resolution. Tests cover invocation from main, from a linked worktree, from subdirectories, and from outside any git repo. - AC-2:
plugin/scripts/run_quality_checks.tsinvoked from a worktree cwd without--configor--baseline-dirflags successfully resolves<main-worktree>/sdlc.yamland<main-worktree>/.sdlc/quality-baselines/. The gate runs and reports the expected result (not the silent-pass-through behaviour it has today). - AC-3:
bun run plugin/scripts/quality_baseline.ts capture <sha>invoked from a worktree cwd writes the baseline to<main-worktree>/.sdlc/quality-baselines/<sha>.json, NOT to the worktree’s local.sdlc/. - AC-4:
plugin/skills/task-work/SKILL.mdStep 3a, Step 7, Step 9 do NOT pass--configor--baseline-dirflags in their example invocations. The prose explicitly states that scripts self-discover. - AC-5: A full
/sdlc:task-work → /sdlc:task-close-outcycle on a fresh task succeeds without any path-related flag being passed manually by the operator. (Runtime AC; observed on first invocation post-merge.) - AC-6:
plugin/scripts/status_dashboard.tsimportsfind_project_rootfrom the shared helper rather than reimplementing the walk inline. (Closes the layering violation surfaced in the slice-4 survey.) - AC-7: All existing tests pass; project quality checks pass.
Out of scope
Section titled “Out of scope”- A local coordination server / RPC layer. Same as the lease task — this refactor keeps the scripts as scripts; future server work is downstream.
- Refactoring every plugin script. Scope this task to the ones currently affected by silent-fallback
bugs (
run_quality_checks.ts,quality_baseline.ts,status_dashboard.ts). Other scripts are surveyed in step 1 but only refactored if the audit shows the same pattern. - Cross-repo
--project-rootoverrides (e.g. running scripts against a sibling consumer project’s.sdlc/). The escape-hatch--project-rootflag covers that; no special-case code needed. - Adding a
project_id:field tosdlc.yaml’s schema. If it doesn’t exist today, this task doesn’t add it; the optional--project-idverification only fires if the field is already present.
Dependencies
Section titled “Dependencies”Soft: T-FRTD-drop-lease-filesystem-cache (merged) establishes the pattern this task generalises — the lease library is already self-discovering. No hard blocker.
Discovery context
Section titled “Discovery context”Surfaced across multiple slice-4 task runs (Tasks B, C, drop-lease-filesystem-cache). The original
framing (T-5X6Y-task-work-step7-explicit-baseline-dir) was “task-work Step 7 must pass
--baseline-dir explicitly.” User feedback on 2026-05-27 broadened the scope: the bug isn’t one
missing flag, it’s that scripts expect callers to know paths the scripts should self-discover. Same
architectural pattern the lease library shipped in T-FRTD-drop-lease-filesystem-cache — “the cwd
is enough, scripts find what they need.”
The user’s framing: “as a general rule we want to simplify scripts as much as appropriate.” This
task encodes that rule for the plugin/scripts/ layer.
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: run_quality_checks.ts —diff-against-baseline defaults its —baseline-dir to the worktree .sdlc, but task-work captures the baseline in the main repo .sdlc; the gate failed with baseline not found until —baseline-dir was passed explicitly. task-work Step 7 should pass the main-repo baseline-dir explicitly. Keywords searched: diff-against-baseline, run_quality_checks, baseline-dir, explicitly, task-work, main-repo, defaults, worktree Excluded: 2026-06-02-port-check-entities-to-ts Top candidates (score / status / headline):
- 134 / closed/superseded / 2026-05-25-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 60 / planning/needs-definition / 2026-05-27-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd Decision: SPAWNED → overridden to LINKED-EXISTING (this active task is the broadened successor that fixes exactly the baseline-dir silent-fallback symptom; the script’s top hit 2026-05-25 is closed/superseded by this one). Linked from T-M5RS-port-check-entities-to-ts post-mortem.
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: Step 7’s gate resolved the baseline dir from the worktree cwd while Step 3a’s capture wrote to the main repo’s .sdlc/quality-baselines/, costing a failed invocation until —baseline-dir was passed explicitly — run_quality_checks.ts could resolve the baseline dir via the git common dir so worktree invocations find the main repo’s cache without the flag Keywords searched: run_quality_checks, quality-baselines, baseline-dir, invocations, invocation, explicitly, resolved, baseline Excluded: T-VWH3-ts-index-generator-script Top candidates (score / status / headline):
- 127 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 84 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 79 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 47 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate ignores baseline-shifting summary and corpus-growth lines
- 34 / planning/draft / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks
—diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
Decision: SPAWNED → overridden to LINKED-EXISTING Rationale: The script’s top hit T-5X6Y (127) is
closed/superseded by exactly this task; T-44OO (rank #2, 84, open/needs-definition) is the active
successor whose Goal names run_quality_checks.ts self-discovering project root via
git rev-parse --git-common-dir— verbatim the bullet’s proposed fix (“resolve the baseline dir via the git common dir so worktree invocations find the main repo’s cache without the flag”). Spawning would be 4th+ coverage of the same protocol friction; linked to the active tracker instead. Linked from: T-VWH3-ts-index-generator-script
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: run_quality_checks.ts —diff-against-baseline resolved the baseline dir from the worktree project root and exited 2 (baseline not found) — Step 3a captures into the main repo .sdlc/quality-baselines/ but task-work Step 7 documented invocation omits —baseline-dir; the skill prose should pass it on both sides (or the executor should fall back to the superproject .sdlc/) so worktree-invoked gates find main-captured baselines. Keywords searched: diff-against-baseline, run_quality_checks, quality-baselines, worktree-invoked, main-captured, baseline-dir, superproject, documented Excluded: T-0014 Top candidates (score / status / headline):
- 69 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 56 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 38 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 18 / planning/draft / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 14 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: SPAWNED → overridden to LINKED-EXISTING Rationale: The script’s top hit T-5X6Y (69) is
closed/superseded by exactly this task; T-44OO (rank #2, 56, planning/needs-definition) is the
active successor whose Goal and Approach step 7 name the worktree
.sdlc/quality-baselines/silent-fallback and thegit rev-parse --git-common-dirself-discovery fix — precisely this bullet’s proposed remedy. This is the third post-mortem to surface the same baseline-dir friction; linked to the active tracker rather than spawning duplicate coverage. Linked from: T-0014
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: run_quality_checks.ts —diff-against-baseline defaults —baseline-dir to the worktree .sdlc/quality-baselines but quality_baseline.ts capture run from the main repo writes to the main repo dir; the gate fails with baseline not found until —baseline-dir is passed explicitly. The two scripts should resolve the same default baseline dir anchored on the superproject root. Keywords searched: diff-against-baseline, run_quality_checks, quality-baselines, quality_baseline, baseline-dir, superproject, explicitly, defaults Excluded: T-F61F-pluggable-claim-resolver-interface-for-task-ensure-ready Top candidates (score / status / headline):
- 95 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 88 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 41 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 34 / planning/draft / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 18 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: LINKED-EXISTING T-44OO-plugin-scripts-self-discover-project-root Rationale: Fourth
post-mortem to surface the same baseline-dir silent-fallback friction. T-44OO is the active tracker
whose Goal/Approach name the run_quality_checks.ts + quality_baseline.ts self-discovery fix via
git rev-parse --git-common-dir— precisely this bullet’s proposed remedy. Linked rather than spawning duplicate coverage. Linked from: T-F61F-pluggable-claim-resolver-interface-for-task-ensure-ready
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: Step 3a baseline lands in main repo .sdlc/quality-baselines but Step 7 run_quality_checks.ts run from the worktree defaults its baseline-dir to the worktree .sdlc so the first invocation missed the baseline; the skill Step 7 invocation should pass baseline-dir pointing at the main repo when run from a worktree Keywords searched: run_quality_checks, quality-baselines, baseline-dir, invocation, baseline, worktree, defaults, pointing Excluded: T-0006 Top candidates (score / status / headline):
- 158 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 145 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 85 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 63 / planning/draft / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 51 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate ignores baseline-shifting summary and corpus-growth lines Decision: LINKED-EXISTING T-44OO-plugin-scripts-self-discover-project-root Linked from: T-0006 Note: fourth post-mortem to surface the same baseline-dir silent-fallback friction (after T-VWH3-ts-index-generator-script, T-0014, and the T-M5RS run); linked to the active tracker rather than spawning duplicate coverage.
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: run_quality_checks.ts —diff-against-baseline defaults its —baseline-dir to the worktree’s .sdlc/quality-baselines/, but task-work Step 3a captures the baseline under the main repo’s dir, so the gate run exits 2 with baseline not found; the gate should resolve the baseline dir against the main checkout (worktree superproject) by default. Keywords searched: diff-against-baseline, run_quality_checks, quality-baselines, baseline-dir, superproject, task-work, defaults, worktree Excluded: T-61OI-check-ancestry-flags-stale-base Top candidates (score / status / headline):
- 149 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 134 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 77 / closed/done / T-XM0B-ensure-ready-script-emits-markers-and-cleanup — ensure-ready emits terminal markers + worktree teardown deterministically from the script, not LLM prose
- 75 / planning/backlog / T-ZFE9-task-work-uses-worktree-skill-md — task-work loads SKILL.md from the worktree, not ${CLAUDE_PLUGIN_ROOT}
- 73 / closed/done / T-SIHV-task-state-frontmatter-commits-on-main-not-worktree-branch — All task-state frontmatter commits land on main; worktree branch is implementation diff only Decision: LINKED-EXISTING T-44OO-plugin-scripts-self-discover-project-root Linked from: T-61OI-check-ancestry-flags-stale-base Note: fifth post-mortem to surface the same baseline-dir silent-fallback friction; AC-2/AC-3 of this task already cover the proposed fix (scripts self-discover the main-checkout .sdlc/ from a worktree cwd). Bullet: The quality gate —baseline-dir defaults to the worktree .sdlc, but Step 3a writes the baseline to the main repo .sdlc; the gate failed baseline not found until —baseline-dir was pointed back at the main repo. task-work Step 7 should pass —baseline-dir main-repo by default. Keywords searched: baseline-dir, task-work, main-repo, defaults, worktree, baseline, quality, pointed Excluded: T-SPBO-commit-helper-routes-through-tempfile Top candidates (score / status / headline):
- 196 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 177 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 101 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 88 / open/ready / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 82 / closed/done / T-XM0B-ensure-ready-script-emits-markers-and-cleanup — ensure-ready emits
terminal markers + worktree teardown deterministically from the script, not LLM prose
Decision: LINKED-EXISTING T-44OO-plugin-scripts-self-discover-project-root
Linked from: T-SPBO-commit-helper-routes-through-tempfile
Note: fifth post-mortem to surface the same baseline-dir worktree-vs-main
silent-fallback friction; the gate looked in the worktree’s
.sdlc/quality-baselines/while Step 3a wrote to the main repo’s — exactly this task’sgit rev-parse --git-common-dirself-discovery scope. Linked rather than spawning sixth-time duplicate coverage.
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: Step 7’s quality run from the worktree defaulted —baseline-dir to the worktree-local .sdlc/
and could not find the Step 3a baseline (written to the superproject .sdlc/quality-baselines/); had
to pass —baseline-dir
- 255 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 167 / closed/done / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 140 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 65 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 47 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: LINKED-EXISTING T-44OO-plugin-scripts-self-discover-project-root Linked from:
T-F31Q-migrate-site-to-bun Note: sixth post-mortem to surface the same baseline-dir
worktree-vs-main silent-fallback friction; Step 7’s quality run from the T-F31Q worktree defaulted
to the worktree-local
.sdlc/and missed the Step 3a baseline written to the superproject. The script’s own decision agreed (LINKED-EXISTING, score 255). Linked rather than spawning duplicate coverage.
Bullet: Step 7’s quality run from the worktree defaults --baseline-dir to
the worktree’s own .sdlc/, but Step 3a captured the baseline into the MAIN
repo’s .sdlc/quality-baselines/, so the gate errored baseline not found
until --baseline-dir <main>/.sdlc/quality-baselines was passed explicitly.
Fix: Step 7 should resolve the baseline dir from the git-common-dir (the
superproject) rather than the worktree cwd, or the SKILL.md should document
the explicit flag.
Keywords searched: diff-against-baseline, quality-baselines, baseline-dir,
git-common-dir, superproject, worktree, step-7, baseline
Excluded: T-VE7H-task-work-probe-keys-package-manager-off-project
Top candidates (score / status / headline):
- 104 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 62 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass
—baseline-dir explicitly to defeat silent fallback in worktree
Decision: LINKED-EXISTING T-44OO-plugin-scripts-self-discover-project-root
Rationale: Sixth post-mortem to surface the same worktree-vs-main
baseline-dir silent-fallback friction. T-44OO is the active successor (T-5X6Y
is closed/superseded by it) whose Goal and Approach step 7 name the
git rev-parse --git-common-dirself-discovery fix — verbatim this bullet’s proposed remedy. Linked to the active tracker rather than spawning duplicate coverage. Originating task: T-VE7H-task-work-probe-keys-package-manager-off-project
Dedup search (spawn-from-post-mortem)
Section titled “Dedup search (spawn-from-post-mortem)”Bullet: sdlc quality run —diff-against-baseline from a worktree defaulted —baseline-dir to the
worktree-local path, so the first run errored ‘baseline not found’; the baseline lives in the
superproject. Needed an explicit —baseline-dir
- 292 / planning/needs-definition / T-44OO-plugin-scripts-self-discover-project-root — Plugin scripts self-discover project root from cwd
- 184 / closed/done / T-TWZD-normalize-baseline-diff-nondeterministic-output — run_quality_checks —diff-against-baseline masks ephemeral tmpdir paths and transient SHAs before line-diffing
- 135 / closed/superseded / T-5X6Y-task-work-step7-explicit-baseline-dir — task-work Step 7 must pass —baseline-dir explicitly to defeat silent fallback in worktree
- 74 / closed/done / T-H69K-run-quality-checks-isolates-pre-existing-drift — run_quality_checks.py only fails on drift the current branch introduced
- 49 / planning/backlog / T-BCNP-quality-gate-ignores-summary-and-corpus-lines — quality-gate
ignores baseline-shifting summary and corpus-growth lines
Decision: LINKED-EXISTING T-44OO-plugin-scripts-self-discover-project-root
Linked from: T-H7LB-task-work-appends-post-mortem-stub
Note: seventh post-mortem to surface the same baseline-dir worktree-vs-main
silent-fallback friction;
sdlc quality run --diff-against-baselinefrom the T-H7LB worktree defaulted to the worktree-local path and missed the superproject baseline. The script’s own decision agreed (LINKED-EXISTING, score 292). Linked rather than spawning duplicate coverage.
Consolidation (/sdlc:consolidate-task-prs, 2026-06-30 UTC)
Section titled “Consolidation (/sdlc:consolidate-task-prs, 2026-06-30 UTC)”Six more single-task-file PRs proposed the same worktree-vs-main baseline-dir
silent-fallback friction and were dropped as duplicates of this tracker
(dedup scores 144–296, all agreeing LINKED-EXISTING): #533
(T-Z2EO-task-work-resolves-baseline-dir), #531
(T-VJYX-quality-run-resolves-superproject-baseline-dir), #529
(T-OIUU-task-work-default-baseline-dir), #528
(T-HHZB-task-work-baseline-dir-main-checkout), #514
(T-A1SR-quality-gate-resolves-superproject-baseline), and #509
(T-5HX8-task-work-threads-main-baseline-dir). Folded by
/sdlc:consolidate-task-prs.
- Duplicate draft proposed in #598 (
T-X9PO-task-work-step7-threads-baseline-dir); folded by /sdlc:consolidate-task-prs into this task. - Duplicate draft proposed in #605 (
T-P6OB-task-work-baseline-dir-main-repo); folded by /sdlc:consolidate-task-prs into this task. - Duplicate draft proposed in #608 (
T-W2TM-baseline-dir-resolves-from-superproject); folded by /sdlc:consolidate-task-prs into this task. - Duplicate draft proposed in #632 (
T-2GGI-step7-baseline-dir-from-main-repo); folded by /sdlc:consolidate-task-prs into this task. - Duplicate draft proposed in #659 (
T-4U2H-quality-run-baseline-dir-from-worktree); folded by /sdlc:consolidate-task-prs into this task. - Duplicate draft proposed in #673 (
T-42LO-task-work-passes-baseline-dir); folded by /sdlc:consolidate-task-prs into this task. - Duplicate draft proposed in #676 (
T-Y28U-resolve-superproject-baseline-dir); folded by /sdlc:consolidate-task-prs into this task.