Repository navigation
A shallow clone leaves a cited commit unchecked - #86
Conversation
A practice's cited commit was a problem whenever git cat-file said missing. In a depth-1 clone, such as a hosted agent sandbox, every older commit is missing, so Stop reported correct citations as "no commit in this repository". When some cited commit is missing, git is now asked if the clone is shallow; if it is, the citations are left unchecked. A full clone, as the workflow ci install writes fetches, still catches a wrong one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: b53cdddb-2e4d-43d2-97ec-a3b067257f29
🦔 PostHog Review (standard) reviewed this pull requestNothing worth raising. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00f1d8d0f0
ℹ️ 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".
pauldambra
left a comment
There was a problem hiding this comment.
Note
🤖 Automated comment by QA Swarm — not written by a human
QA Swarm review complete. See inline comments.
|
Note 🤖 Automated comment by QA Swarm — not written by a human Multi-perspective review: router (cheap-first pass) + delegated lenses (qa-team, paul-reviewer, xp-reviewer, security-audit, engineering-systems-thinking as warranted) Verdict: ✅ APPROVE (round 3 @ ae1534c)Moving the shallow-aware check into Key findings
Reviewer summaries
Previous rounds (2)round 1 @ 00f1d8d — 💬 APPROVE WITH NITS: shallow fallback hid provable wrong citations (fixed in c3ad7bb); Automated by QA Swarm — not a human review |
The shallow fallback left every commit citation unchecked once one was
missing. But a hash that names a file or a tree the clone holds, or
several objects, is no commit at any depth. In a shallow clone, the
missing citations are now asked of git again without ^{commit}, and only
those that name nothing here stay unchecked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated-By: PostHog Desktop
Task-Id: b53cdddb-2e4d-43d2-97ec-a3b067257f29
defect --introduced asked git cat-file -e <sha>^{commit}, so in a
depth-1 clone it refused any older commit as "no commit by that name",
the same blind spot the practice citation check had. The shallow-aware
check moves from spec/practices.ts to journal/commits.ts, and both the
practice check and defect --introduced use it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated-By: PostHog Desktop
Task-Id: b53cdddb-2e4d-43d2-97ec-a3b067257f29
pauldambra
left a comment
There was a problem hiding this comment.
Note
🤖 Automated comment by QA Swarm — not written by a human
QA Swarm review complete. See inline comments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: b53cdddb-2e4d-43d2-97ec-a3b067257f29
…by via The parameterized tests gave each case its own name, so no test was named by the via: lines, and run and refute selected nothing. Each loop now sits in a describe block named by its via. Both invariants were then refuted with the break staged, restored byte for byte, and run green batched and alone; the run store records it. The alone run used NODE_OPTIONS=--test-reporter=tap, because Node 24 prints "ℹ pass" by default and the config's testMatch reads "# pass". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: b53cdddb-2e4d-43d2-97ec-a3b067257f29
A shallow clone no longer reads a correct commit citation as no commit: practice citations and defect --introduced ask git whether the clone is shallow, and there report only a hash that names some other object, or several (#86). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: b53cdddb-2e4d-43d2-97ec-a3b067257f29
🤖 This PR was written by a robot (Claude, via PostHog Desktop) for @pauldambra.
Why
In a shallow clone, the Stop hook said that correct commit citations in practice files were "no commit in this repository". A hosted agent sandbox clones at depth 1, so every older commit looks missing. In ops-platform, all the cited commits exist on GitHub.
What
missingCommitsnow asks git if the clone is shallow. It asks only when some cited commit is missing. In a shallow clone, a commit that is not there is not reported, because the clone depth may have cut it off.A full clone still reports a commit that does not exist. The workflow that
ci installwrites fetches full history, so CI still catches a wrong citation.coherence defect --introduced <sha>had the same problem: in a shallow clone it refused any older commit. The check now lives in one place,src/journal/commits.ts, and both the practice check anddefect --introduceduse it.In a shallow clone, a hash that names a file or tree the clone holds, or more than one object, is still reported, because it is no commit at any depth.
New invariant in
Spec.spec.mdand parameterized tests inpractice.test.tsanddefects.test.ts, and a new invariant inJournal.spec.md.Bumps the version to 1.7.1. When this merges, the Release workflow publishes 1.7.1 to npm.
Checks
spec --checkgave 12 "no commit" problems before this change and 0 after.typecheck,spec:checkandlexicon:checkpass.practice.test.tsanddefects.test.tspass.coherence refute(each break made its test go red), restored, and found green byrun, batched and alone. Both read asinvariant.🤖 Generated with Claude Code
Created with PostHog Desktop