Skip to content

feat(scaffold): migration 0007 ignores .taskless/.tmp-* scratch files - #342

Merged
thecodedrift merged 2 commits into
openspec/qualitative-survey-feedbackfrom
survey/01-ignore-scratch-files
Sep 18, 2026
Merged

thecodedrift merged 2 commits into
openspec/qualitative-survey-feedbackfrom
survey/01-ignore-scratch-files

Conversation

@thecodedrift

@thecodedrift thecodedrift commented Sep 18, 2026

Copy link
Copy Markdown
Member

Stack (root → tip):

Slice 1 of 4 of qualitative-survey-feedback (stacked on #341, the proposal). Bottom of the implementation stack; the changeset lives here.

What

  • 0007-ignore-scratch-files.ts: addToGitignore(cwd, ["/.tmp-*"]), registered as "7". 0001 is not edited; a fresh scaffold runs 1 through 7 and ends with the same .gitignore an upgraded one has.
  • Anchored with a leading / for the reason 0001 anchors /sgconfig.yml: an unanchored pattern would match inside a rule directory.
  • This repository's own scaffold migrated (.taskless/.gitignore gains the line, taskless.json records 7).
  • Changeset: patch. The scaffold's own version field carries the compatibility signal.

Tests

test/migrate-ignore-scratch-files.test.ts: version-6 scaffold gains the line and records 7 with existing entries intact; fresh scaffold ends with all three entries; migration is idempotent; and git check-ignore confirms a .taskless/.tmp-feedback.json is ignored (asks git rather than re-deriving its rules). The existing forward-migration matrix picks up v6 → v7 automatically since it derives from LATEST_SCHEMA_VERSION.

Refs #341

The agent recipes write scratch request files under .taskless/ and end
with a clean-up step an agent can skip. Ignore /.tmp-* so a forgotten
file is a stray rather than a commit. A migration rather than an edit to
0001, which is frozen: a fresh scaffold runs 1 through 7 and ends with
the same file. This repository's own scaffold is migrated in the same
commit.
…urce

The stub's frontmatter description was last written on 2026-08-24 and
still names the CLI invocation, which b8b6f32 removed from the source on
purpose: a stub's description never goes through the build-target
rewrite, so a spelled-out invocation there freezes an unpinned reference
into every nightly install. Re-running init brings it up to date.
@thecodedrift

Copy link
Copy Markdown
Member Author

@claude /review

@claude

claude Bot commented Sep 18, 2026

Copy link
Copy Markdown

Claude finished @thecodedrift's task in 3m 19s —— View job


Review mode: incremental — read 0 prior review thread(s) before reviewing.

.prior-review.json contained no review threads, review summaries, or top-level comments beyond the @claude /review trigger itself, so there is nothing previously raised to classify as addressed or still-open. This is effectively the first substantive review of this PR.

  • Read .prior-review.json
  • Fetch PR diff and metadata (gh pr diff 342, gh pr view 342)
  • Review changed files in full context (traced Migration call sites, addToGitignore, runMigrations, sibling migrations 0001/0004/0006, the test matrix, and the canonical skill source)
  • Post findings

Assessment

This is a clean, well-scoped slice. Walked through the whole chain and didn't find a correctness bug:

  • 0007-ignore-scratch-files.ts: Migration is invoked with the .taskless directory (see runMigrations in migrate.ts:494, await migrate(tasklessDirectory)), and dirname(directory) correctly recovers the project root — the same result 0001-init.ts gets via join(directory, ".."). addToGitignore then re-derives .taskless internally, so the round trip is correct and matches the established pattern.
  • Anchoring: /.tmp-* anchors to .taskless/ itself, consistent with 0001's /sgconfig.yml reasoning — an unanchored pattern would also match a rule directory's own file of that name.
  • Registration: migrate.ts registers "7": ignoreScratchFiles and leaves 0001 untouched, matching the PR description. LATEST_SCHEMA_VERSION is derived from the migration map, so the existing migrate-install.test.ts matrix picks up 6→7 automatically, as claimed.
  • Idempotency / fresh-install / upgrade paths: all three are exercised in migrate-ignore-scratch-files.test.ts, and the "asks git rather than re-deriving its rules" git check-ignore test is a good way to verify the actual guarantee that matters (a real scratch file becomes invisible to git status), consistent with this repo's existing pattern of shelling out to real git in tests (check-gitignore.test.ts, check.test.ts, etc.).
  • Self-hosting: this repo's own .taskless/.gitignore and taskless.json (version: 7) were updated in the same commit, per the "a migration owns everything under .taskless/" rule documented in migrate.ts.
  • Changeset: patch, placed on this bottom-of-stack PR — correct under the 0.y.z "added surface is still patch" rule in the repo's CLAUDE.md, and correctly placed per the stacked-PR changeset convention.
  • Unrelated-looking second commit (.agents/skills/taskless/SKILL.md): this drops a hardcoded npx @taskless/cli prefix from the frontmatter description's agent route reference. Verified this brings the stub back in sync with the canonical skills/taskless/SKILL.md and the other installed stub copy (.claude-pr/.claude/skills/taskless/SKILL.md), both of which already read plain `agent route` with no prefix — so this is a real drift fix, not noise, and it's a good example of the exact frontmatter-vs-body distinction the commit message draws (the body's npx @taskless/cli init recovery line is a different, intentionally-frozen mechanism handled by stubRecoveryInvocationStale, and is correctly left alone here).

Nothing NEW to flag beyond the above observations, which are confirmations rather than issues. No inline comments filed.

@thecodedrift

Copy link
Copy Markdown
Member Author

Re: @claude[bot] — "Claude finished @thecodedrift's task in 3m 19s … Nothing NEW to flag beyond the above observations"
#342 (comment)

Read; no findings to act on. The stub refresh commit is intentional and is described in its own message.

— AI Coding Agent

@thecodedrift
thecodedrift added this pull request to stack #346 September 18, 2026 17:58
@thecodedrift
thecodedrift merged commit f7ecbce into main Sep 18, 2026
4 checks passed
@thecodedrift
thecodedrift deleted the survey/01-ignore-scratch-files branch September 18, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Open OpenSpec Contains unresolved OpenSpec changes. All openspec changes must eventually reach an archive state.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant