Skip to content

fix(work-items): detect the overlay ignore stop condition without appending a duplicate (0.39.21) - #3219

Merged
kyle-sexton merged 6 commits into
mainfrom
cursor/3132-check-ignore-cfcf
Aug 24, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
cursor/3132-check-ignore-cfcf

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #3132

Summary

work-items setup used a bare git check-ignore to decide whether the personal overlay was ignored. That probe is silent for a tracked file, so the stop condition was undetectable and apply appended a duplicate ignore line as the "fix". Setup now uses two independent probes, and the ignore verdict comes from the bare --no-index exit code so a negation rule cannot look like coverage.

Fix

Port source-control's two-probe form into setup step 5 and check probe 2, documented once in setup/reference/overlay-ignore-probes.md:

  • git check-ignore --no-index -q answers whether the path is ignored (no -v in the verdict — -v reports negation patterns and still exits 0)
  • git ls-files answers whether the path is tracked

A tracked overlay stops and names git rm --cached. Untracked and uncovered appends the ignore line. Untracked and covered changes nothing.

Also from the same audit: overlay allowlist covers config.linear.auth_env / config.gitea.auth_env; invalid binding at <path> points at /work-items:setup check on all five emitters; the two docs strings are reconciled to the consumer-facing form; CONTRACT.md no longer calls the project dir and the git toplevel "that single anchor".

Verification

bash plugins/work-items/tools/work-item-tracker/lib/binding.test.sh — 69 PASS (including the new linear/gitea overlay allowlist cases).

plugins/work-items/skills/setup/SKILL.md is 499 lines (under the 500-line skill-gate cap).

check-changelog-parity.sh --check-bump origin/main passes (0.39.19).

Related

  • plugins/source-control/skills/setup/reference/apply-convention.md — the sibling layer=local snippet this ports; its -v exit-code verdict is the same inherited defect and needs its own item
  • ADR 0015 — overlay allowlist; this PR widens it for linear/gitea auth_env

@claude

claude Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 10s —— View job


Security review

  • Gather context (PR diff, changed files)
  • Review shell scripts (binding.sh, adapters, common.sh templates) for injection/logic issues
  • Review setup SKILL.md and reference doc for the ignore-probe logic
  • Review CONTRACT.md and evals.json changes
  • Post findings

No security issues found.

This PR is a correctness fix for the personal-overlay gitignore detection logic plus a docs/messaging cleanup; it has no security-relevant surface beyond a small, already-safe credential-config widening. Specifics:

  • Overlay-ignore probes (overlay-ignore-probes.md) — $OVERLAY is a hardcoded literal (.work-item-tracker.local.json), and $REPO_ROOT is only ever passed to git -C, never interpolated into a string that's evaluated — no injection surface. The verdict now correctly comes from the bare check-ignore --no-index exit code rather than -v's (which reports negation matches and still exits 0), closing the false-"covered" gap the PR describes.
  • Overlay allowlist widened to config.linear.auth_env / config.gitea.auth_env (binding.sh#L50) — this only lets a personal overlay name which env var holds a credential, not the credential value itself. Both adapters validate the resulting name against ^[A-Za-z_][A-Za-z0-9_]*$ before dereferencing it via ${!name} (linear/common.sh#L262, gitea/common.sh#L246), mirroring the pre-existing jira pattern — no arbitrary-code/indirection risk is introduced.
  • The remaining changes (error-message text pointing at /work-items:setup check, CONTRACT.md/SKILL.md doc wording, evals.json/binding.test.sh additions, version bump) are non-functional or test-only.

Per the security-review skip criteria, this stops here — no findings to report.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24fbc80513

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Last security-reviewed head: ef238126af76aebe9a327e01e7cac642fc9078ec. On the next push, the relevance gate compares only the commits since this SHA; delete this comment to force a full re-review.

@claude

claude Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 46s —— View job


Code review complete

  • Load /review:code-review skill instructions
  • Gather context (diff, CLAUDE.md, REVIEW.md)
  • Check skip gate (PR open, non-trivial change, no prior applicable review — proceeded)
  • Review changed files for correctness/maintainability
  • Post inline findings
  • Final summary

This repo carries a .github/workflows/claude-security-review.yml, so per REVIEW.md security findings are out of scope for this lane; none of note surfaced anyway.

1 finding posted inline (🔴 Important) — plugins/work-items/skills/setup/evals/evals.json lines 207-213 (eval id 16): the eval's expected_output/expectations prescribe git check-ignore --no-index -v as the probe for whether an ignore rule exists, but that's exactly the verdict-from--v bug this PR fixes. The reference doc, SKILL.md, and eval 18 (a few entries below) all correctly require the bare (no -v) exit code for the verdict, with -v used only for the human-readable report. As written, eval 16 would grade a correct implementation as failing and a re-introduced bug as passing.

Everything else checked out:

  • The two-probe design in the new setup/reference/overlay-ignore-probes.md (check-ignore --no-index -q for the verdict, ls-files for tracked-state, -v only for reporting) is correctly reflected in SKILL.md steps 5 and check probe 2.
  • binding.sh's allowlist widening (config.linear.auth_env, config.gitea.auth_env) is covered by new tests in binding.test.sh, including negative cases confirming the rest of each subtree stays rejected.
  • The five invalid binding at <path> emitters (dispatcher, jira/gitea/linear adapters, onboard-adapter's template) consistently point at /work-items:setup check.
  • CONTRACT.md's new ${CLAUDE_PROJECT_DIR} vs. git-toplevel divergence note matches the actual wit_project_root() implementation in binding.sh (single resolution function used consistently), and the worktree scenario described is accurate.
  • CHANGELOG.md and the plugin.json version bump (0.39.18 → 0.39.19) are consistent with the changes.

@github-actions

github-actions Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude has reviewed this PR 3 times. The lane skips further automatic reviews after 5; deleting this comment resets the count.

@kyle-sexton
kyle-sexton enabled auto-merge (squash) August 23, 2026 22:05
@kyle-sexton kyle-sexton added priority: medium status: ready Triaged, unblocked, and fully specified; eligible to pick up. agent-ready Fully specified and briefed; eligible for autonomous pickup from the frontier. labels Aug 23, 2026
@claude

claude Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @cursor[bot]'s task in 4m 0s —— View job


Code review complete

  • Load /review:code-review skill instructions
  • Gather context (diff since last review, CLAUDE.md, REVIEW.md)
  • Review changed files for correctness/maintainability
  • Post inline findings
  • Final summary

This is a re-review after synchronize — the latest commit (5fda688, "align eval 16 and overlay-allowlist docs with the probes") addresses both findings raised in the prior two review passes on this PR:

  • Eval 16's grading criteria now match the fix. evals.json now requires the bare git check-ignore --no-index -q for the ignore verdict, consistent with overlay-ignore-probes.md, SKILL.md, and eval 18. Previously it prescribed -v, which would have graded a correct implementation as failing.
  • Overlay allowlist docs reconciled. plugins/work-items/README.md, ADR 0015, the config-cascade Implementers table, and binding.sh's comments/error string now all name linear/gitea auth_env alongside jira, matching the widened executable allowlist Codex flagged as undocumented.

I re-verified the rest of the diff for anything new since the last full pass:

  • binding.sh's allowlist-membership jq logic and the new binding.test.sh cases for linear/gitea overlay handling are correct (allowlisted scalar keys merge, non-allowlisted keys and object/array-valued allowlisted keys are rejected, scaffolding objects pass through).
  • The new setup/reference/overlay-ignore-probes.md correctly centralizes the two-probe logic (bare exit code for the verdict, -v only for reporting) and is consistent with SKILL.md steps 5/check probe 2.
  • CONTRACT.md's ${CLAUDE_PROJECT_DIR} vs. git-toplevel divergence note (worktree case) reads accurately against wit_project_root()'s actual behavior.
  • plugin.json/CHANGELOG.md version and changelog entry are internally consistent (0.39.20, one ### Fixed section, no duplicate headers).
  • The five invalid binding at <path> emitters (dispatcher, jira/gitea/linear adapters, onboard-adapter template) consistently point at /work-items:setup check.

No new findings — nothing to post inline.

@kyle-sexton kyle-sexton changed the title fix(work-items): detect the overlay ignore stop condition without appending a duplicate (0.39.19) fix(work-items): detect the overlay ignore stop condition without appending a duplicate (0.39.21) Aug 23, 2026
@cursor
cursor Bot force-pushed the cursor/3132-check-ignore-cfcf branch from e7e9e81 to 0cfa6c7 Compare August 23, 2026 22:37
@kyle-sexton
kyle-sexton force-pushed the cursor/3132-check-ignore-cfcf branch from 0cfa6c7 to 0b30e58 Compare August 23, 2026 23:34
@claude

claude Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 28s —— View job


Security review

  • Gather context (PR diff since prior reviews, CLAUDE.md)
  • Invoke /review:security-review skill and follow its instructions
  • Post findings

No security issues found.

Diffed origin/main...HEAD at the current head (0b30e585) — the 18 changed files match the PR description exactly, and the last commit (0b30e585, a changelog-heading dedup) is non-functional. I re-verified the security-relevant surfaces from scratch rather than trusting the prior "last-reviewed head" markers, since this branch's history has been rewritten since the earlier passes (neither 24fbc8051308c3b48259d75d2f294e86b5d87eb9 nor e7e9e81ef9b7eebe5e5ffe914a575c71a1ae04d1 is an ancestor of the current head).

  • Overlay-ignore probes (overlay-ignore-probes.md) — $OVERLAY is a hardcoded literal, $REPO_ROOT only reaches git -C, never an evaluated string. No injection surface. The ignore verdict now correctly comes from the bare check-ignore --no-index exit code, not -v's (which reports negation matches and still exits 0) — this closes the false-"covered" gap where a credential-bearing overlay could stay tracked while the tooling reported it handled.
  • Overlay allowlist widened to config.linear.auth_env / config.gitea.auth_env (binding.sh#L51) — this only lets a personal overlay name which env var holds a credential, never the value. Confirmed both adapters still validate the resulting name against ^[A-Za-z_][A-Za-z0-9_]*$ before dereferencing via ${!name} (linear/common.sh, gitea/common.sh), mirroring the pre-existing jira pattern — no arbitrary-indirection risk.
  • The remaining diff (error-message text pointing at /work-items:setup check, CONTRACT.md/SKILL.md/README/ADR wording, evals.json grading-criteria fix, binding.test.sh additions, version/changelog bumps) is non-functional or test/doc-only.

Per the security-review skip criteria, this stops here — no findings to report.

kyle-sexton and others added 6 commits August 23, 2026 23:51
…n probe

setup's personal-overlay gitignore step ran a bare `git check-ignore`, then
demanded that a *tracked* overlay be stopped and reported. Bare `check-ignore`
consults the index and exits 1 with no output for an already-tracked path,
because gitignore rules do not apply to tracked files, so the very condition the
step exists to catch was invisible to the probe meant to catch it: `apply` read
the silence as "no rule", appended a duplicate `.gitignore` line, and announced
it as the fix while the overlay stayed in team history.

Replace it with the two independent probes sibling `source-control` already
ships for its own local overlay (`apply-convention.md`, `layer=local`):
`git check-ignore --no-index -v` for whether a rule exists at all, and
`git ls-files` for whether the path is in the index. `check` probe 2's overlay
clause gets the same pair for the same reason. Two eval cases cover the tracked
stop and the untracked-uncovered append.

Also from the same audit:

- Allowlist `config.linear.auth_env` and `config.gitea.auth_env` for the
  personal overlay. Both adapters read the credential's env-var NAME from the
  merged view and the "auth identity is per-account" rationale already covered
  them, so their omission was a silent exit-3 denial CONTRACT.md did not
  predict. The rest of both subtrees stays team-layer-only.
- Point `invalid binding at <path>` at `/work-items:setup check`, which
  itemizes which validation condition failed.
- Reconcile the two `docs` pointer strings; CONTRACT.md's variant embedded a
  `plugins/work-items/...` monorepo path that resolves to nothing in a consumer
  repo.
- Stop calling `${CLAUDE_PROJECT_DIR}` and the git toplevel "that single
  anchor". They diverge inside a worktree, verified on this machine.

Closes #3132

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014QH5jtNyrDCYYsDgxMxkHk

Co-authored-by: Kyle Sexton <[email protected]>
…tup check

The jira, gitea, and linear adapter preambles each carry their own copy of the
`invalid binding at <path>` string, so pointing only the dispatcher's copy at
`/work-items:setup check` left three of the four emitters printing the old
message. A user whose failure surfaces through an adapter got no route to the
itemized breakdown.

Refs #3132

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014QH5jtNyrDCYYsDgxMxkHk
…t code

Independent review caught that the ported snippet derived HAS_RULE from the exit
code of `git check-ignore --no-index -v`. With `-v`, git reports NEGATION
patterns as matches and still exits 0, so that exit code means "some pattern
matched", not "the path is ignored".

Verified on this machine (git 2.55.0.windows.3) with `.gitignore` carrying
`*.json` then `!.work-item-tracker.local.json`, overlay untracked:

  check-ignore --no-index      -> exit 1   (correct: NOT ignored)
  check-ignore --no-index -v   -> exit 0   (matched the negation rule)
  git status --porcelain       -> ?? .work-item-tracker.local.json

The `-v` reading would have routed to "already covered, change nothing" for an
overlay git does not ignore at all, leaving it exposed to `git add -A` and
steering away from the append that does fix it (last matching rule wins,
verified). That is the same failure shape this change exists to remove.

The verdict now comes from the bare `--no-index -q` exit code; `-v` is used only
to render the matching rule in the report. This defect is inherited from the
sibling snippet at source-control's apply-convention.md:288, which needs its own
item.

Also from the same review:

- Move the probe description into `setup/reference/overlay-ignore-probes.md`.
  Inlining it pushed SKILL.md to 525 lines, past this repo's 500-line hard cap;
  the skill gate now passes at 499. Both callers cite the one spoke.
- Update the fifth `invalid binding at` emitter, `onboard-adapter`'s
  `common.sh.tmpl`, which seeds every consumer-authored adapter.
- Two more eval cases (18, 19) for the negation branch and for a tracked overlay
  that no rule covers, the two combinations 16/17 left uncovered.
- Drop "silent" from the F4 changelog entry (the denial names the offending key;
  it was undocumented, not silent) and stop claiming `check` itemizes all eight
  validation conditions, which it does not.

Refs #3132

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014QH5jtNyrDCYYsDgxMxkHk
…obes

Eval 16 prescribed git check-ignore -v as the coverage verdict, which is
the negation-pattern false positive this change exists to prevent. Take
the verdict from --no-index -q and document linear/gitea auth_env on the
same overlay allowlist the seam already implements.

Closes #3132

Co-authored-by: Kyle Sexton <[email protected]>
Markdown hygiene rejects two ### Fixed sections under one version.

Co-authored-by: Kyle Sexton <[email protected]>
MD012 rejects two consecutive blank lines in CHANGELOG.md.

Co-authored-by: Kyle Sexton <[email protected]>
@kyle-sexton
kyle-sexton force-pushed the cursor/3132-check-ignore-cfcf branch from 0b30e58 to ef23812 Compare August 23, 2026 23:52
@claude

claude Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 17s —— View job


Security review

  • Gather context (PR diff at current head ef23812, CLAUDE.md)
  • Invoke /review:security-review skill and follow its instructions
  • Post findings

No security issues found.

Skip gate condition 3 applies: this head already has a successful security review that still applies. The prior full pass (at 0b30e58) already covered all 18 files this PR touches, including the security-relevant surfaces:

  • Overlay-ignore probes (overlay-ignore-probes.md) — $OVERLAY is a hardcoded literal, $REPO_ROOT only ever reaches git -C, never an evaluated string; no injection surface. The verdict now correctly comes from the bare check-ignore --no-index exit code rather than -v's (which reports negation matches and still exits 0).
  • Overlay allowlist widened to config.linear.auth_env / config.gitea.auth_env (binding.sh) — only lets a personal overlay name which env var holds a credential, never the value; both adapters still validate the resulting name against ^[A-Za-z_][A-Za-z0-9_]*$ before dereferencing via ${!name} (linear, gitea), mirroring the pre-existing jira pattern.

The two commits since that review (330fc94, ef23812) touch only plugins/work-items/CHANGELOG.md, removing a duplicate ### Fixed heading and an extra blank line — no code, probe logic, or allowlist changes. I diffed 0b30e585ba66b1bcd995e66cd6eb46c0a228c60f..HEAD directly to confirm: within this PR's file set, the only delta is that whitespace/heading fix (the diff also shows one unrelated docs/conventions/shell-test-helpers/README.md change from main drift, which is not part of this PR).

Per the security-review skip criteria, this stops here — no findings to report.

@kyle-sexton
kyle-sexton merged commit 70cd16b into main Aug 24, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the cursor/3132-check-ignore-cfcf branch August 24, 2026 00:05
@claude

claude Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 2s —— View job


Code review

  • Load /review:code-review skill instructions
  • Check skip gate
  • Post result

Skip gate hit: PR is closed (merged).

Per /review:code-review's skip gate, condition 1 ("PR is closed or not open") applies — this PR was merged prior to this run (base main already contains the squashed commit 70cd16b, "fix(work-items): detect the overlay ignore stop condition without appending a duplicate (0.39.21)"). There's no open PR state to attach a review to, so per the skill's instructions I'm stopping here without posting inline findings.

For reference, all substantive findings raised during this PR's earlier review passes (eval 16's -v-vs-bare-exit-code grading bug, and the overlay-allowlist doc reconciliation for linear/gitea auth_env) were already addressed in-branch before merge, per the prior review comments on this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-ready Fully specified and briefed; eligible for autonomous pickup from the frontier. status: ready Triaged, unblocked, and fully specified; eligible to pick up.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

work-items/setup: bare git check-ignore cannot detect its own stop condition; apply appends a duplicate ignore line as the "fix"

1 participant