Commit 1319742
authored
* fix(guard-sync): worktree discovery, fail-closed checker, full pre-push range
Sync orama #255 CodeRabbit reviews 4835024659/4835288649 (dd8bcba3, 458a5ab9):
- git -C rev-parse for linked worktree siblings
- exact CLI arity (reject surplus args)
- fail-closed when checker missing in sync + pre-push
- scan full outgoing commit range for scripts/git/ touches
- 5 pytest cases including worktree + surplus-arg
* docs(memory): combine CodeRabbit review wave report + graduate lessons
Working memory: CODERABBIT_REVIEW_WAVE_4835024659_4835288649_2026-08-01.md
Lessons: markdownlint cli2 per-dir config, guard-sync fail-closed,
PR-body Layer 0 operator grant path.
* fix(pr-body): sync remind-pr-body Layer 0 messaging from orama #255
* feat(security): sync HMAC grant v2 PR-body path from orama-system
Synced via scripts/git/sync-attribution-guard-scripts.sh from orama
branch 2026-08-02-pr-body-grant-hmac-mvp: grant lib, hooks, append script,
pre-push range_for_ref, guard-sync test, PR-body tests. CODERABBIT wave doc
provenance updated.
* docs(memory): chronicle PR-body HMAC grant MVP saga (2026-08-02)
Saga, decision JSONL, WORKSPACE refresh, and CodeRabbit wave Batch F for
post-#255 grant v2 implementation. Pairs with orama branch
2026-08-02-pr-body-grant-hmac-mvp for PT PR #320.
* docs(memory): weld verification + research export index
Saga weld checklist; README indexes local-only EXA exports (not committed
due to hygiene). Pairs with orama 2026-08-02-pr-body-grant-hmac-mvp.
* fix(security): sync grant remediation F1–F7 from orama canonical
Replay state machine, GH_BIN append test, saga path hygiene for CI gate.
* docs(agent): refresh grant remediation memory across PT .agent
Update workspace, saga, decisions JSONL, CodeRabbit Batch G, semantic
DECISIONS, and graduate five lessons (replay state machine, canonical
payload, same-user boundary, HMAC override, path hygiene).
* sync(grant): scrub_dsstore + can-6 remediation from orama #260
Mirror guard-sync manifest, scrub_dsstore.sh, grant v2 hardening, expanded
tests, githooks -x guard, and WORKSPACE markdownlint fixes.
* fix: PT PR #320 remediation (can-7.md) + 4 lessons from this session
Remediation, verified against current code before fixing each finding:
- lessons.jsonl + graduated candidates: removed remaining /tmp literals
from lesson_1a6dc6bccad0's rationale AND decisions[1].notes (2 fields,
same file, review only caught one on first pass); reworded
lesson_d1f3789d4592's claim from "Human-authorized" to "operator-gated"
since the HMAC grant proves operator action, not human identity.
- HMAC payload terminology: digest -> content_digest, verified against
the actual implementation as canonical.
- DECISIONS.md: excluded from MD013 (matching SKILL.md/LESSONS.md
precedent, confirmed append-only/machine-grown), then fixed the
remaining ~10 blank-line/bare-URL issues directly; also corrected
content describing "gh pr edit" as a direct agent step when it's
actually internal to append-pr-body.sh.
- WORKSPACE.md's ambiguous "26 passed (orama + PT)" claim: actually ran
the real test command in both repos separately (26 confirmed real in
each, not a stale copy-paste) and rewrote the doc to state this
unambiguously.
- .githooks/pre-commit: fixed a real fail-open gap -- hygiene script
present but python3 missing was silently falling through to a much
narrower identity-only check with no warning. Now fails closed.
- pr-body-grant-lib.py: pr_number had zero validation anywhere before
reaching the canonical HMAC payload; repo's validator only checked for
pipe characters, not newlines. Added _validate_pr_number, extended
_validate_repo_slug, wired both into mint_grant and verify_grant_fields.
3 new regression tests, one initially exposed a real subtlety: a naive
first draft using an inactive override made the test pass regardless
of whether the fix was present, since the first command already denied
on its own -- corrected by testing with the real bypass condition
documented in this commit's own lesson below.
Also fixed 5 pre-existing markdownlint violations pulled into scope on
the SAGA doc once this commit touched it -- hand-authored narrative,
fixed properly rather than excluded.
4 lessons graduated (checked existing lessons first to avoid
re-capturing anything already recorded):
- lesson_a791e2ee5ad6: the exclude-vs-fix decision for lint violations
in machine-rendered vs hand-authored files, generalized from this
session's concrete applications.
- lesson_9cc7ae1a5f12: verifying findings against current code before
fixing catches already-resolved/stale findings, saving real effort.
- lesson_4c65d5956822: shell-command guards must split on bare newlines
too, not just &&/;/||, and the specific way a badly-mocked test can
pass without proving anything about the real vulnerability.
- lesson_5fb495abcfbc: a combined existence-and-availability guard
condition silently downgrades security coverage when the dependency
is missing but the primary script exists -- separate the conditions.
29/29 tests pass (full suite: grant lib, append flow, guard core,
divergence checker). 985 lessons.jsonl lines, zero duplicate IDs, all 4
new lessons' episodic mirrors confirmed. Hygiene clean.
* fix: markdownlint config schema mismatch -- CI's pinned action runs a much older version than tested locally
The earlier .markdownlint-cli2.jsonc fix used an overrides/filter/combine
block that worked when tested with a locally-installed markdownlint-cli2
(v0.23.2, markdownlint v0.41.1) but CI's pinned
davidanson/markdownlint-cli2-action@v19 actually runs markdownlint-cli2
v0.17.2 (markdownlint v0.37.4) -- a much older version that doesn't
support that config schema at all. It silently ignored the override and
CI failed on the full, unexempted DECISIONS.md (68 violations).
Caught by installing the exact CI-matching version locally
(npm install -g markdownlint-cli2@0.17.2) rather than trusting the newer
local install, and confirmed empirically that the simpler key
works correctly across both versions. Replaced overrides with ignores
for DECISIONS.md/LESSONS.md/SKILL.md; reverified clean against the
CI-matching version, not just the newer local one.
Also fixed 2 genuine pre-existing MD013 violations in
CODERABBIT_REVIEW_WAVE_...md, pulled into scope once this commit touched
it -- hand-authored narrative, fixed directly.
29/29 tests pass. Hygiene clean. Reverified with markdownlint-cli2 v0.17.2
specifically (the real CI version), not the newer local default.
* fix(memory,ci): restore superseded lesson link + MD013-only markdownlint overrides
- lesson_d1f3789d4592 supersedes lesson_4c914783ec46 in lessons.jsonl
- Replace ignores with MD013 overrides for SKILL.md and skills tree
(CodeRabbit #320 review 4837623699)
* memory: 3 lessons + report from the markdownlint version-mismatch / gitleaks debugging session
3 lessons graduated:
- lesson_77ce859d6970: verify CI-tool config fixes against the exact
pinned tool version CI actually runs, not the newest locally-installed
version -- a config schema can silently work locally and do nothing
in CI if the actually-pinned version doesn't support it.
- lesson_084412e4e566: secret scanners that scan full commit history
(not just current tree state) can keep flagging already-superseded
commits whose problematic content was fixed later on the same branch
-- the fix is a scoped commit-SHA allowlist, not another file edit.
- lesson_5f0362a3f95f: never extend a short git SHA by guessing/padding
hex characters -- always git rev-parse it. A fabricated SHA in a
security-tool allowlist silently matches nothing while looking
syntactically correct.
Plus a compact narrative report
(2026-08-02-ci-tool-version-and-gitleaks-remediation-report.md) of the
actual debugging arc across both repos, ending in a reusable checklist
for the next CI-tool-config fix.
Checked existing lessons first (2 incidental keyword matches, both
unrelated on inspection) before graduating anything, to avoid
duplicating already-captured claims.
975 lessons.jsonl lines, zero duplicate IDs, all 3 new lessons'
episodic mirrors confirmed. Report itself verified with the CI-matching
markdownlint-cli2 v0.17.2, not the newer local default -- applying the
lesson it documents. Hygiene clean.
* fix: revert regression -- restore working markdownlint ignores config
A later commit on this branch (1ccca81, applying orama PR #320 review
4837623699) replaced the working ignores-based MD013 exemption with the
overrides/filter/combine schema already proven this session not to work
against CI's actually-pinned markdownlint-cli2 v0.17.2 -- reintroducing
the exact CI failure that had already been diagnosed and fixed.
Restored the ignores-based config, verified against the exact CI-pinned
tool version (markdownlint-cli2 v0.17.2, not the newer local default):
SKILL.md, docs/LESSONS.md, and .agent/memory/semantic/DECISIONS.md all
correctly exempted, 0 issues.
29/29 tests pass. Hygiene clean.
* sync: propagate orama PR #260's guard-script fixes to PT exactly
Compared PT's PR #320 branch against orama's PR #260 branch (the source
of truth for this session's pr-body-guard/grant work) across the full
guard-script ecosystem -- scripts/cursor/hooks/*, scripts/cursor/
{append-pr-body,grant-pr-body-human-override,pr-body-grant-lib}.*,
scripts/cursor/hooks.json.template, scripts/git/check-guard-sync-
divergence.sh, and the matching test files. Several were already synced
from earlier work this session on this same branch; this pass filled
the remaining gap -- PT was missing the entire grant-v2 HMAC library
(pr-body-grant-lib.py) and its human-override grant script entirely,
and had a stale copy of pr-body-guard-core.py without the newline-
segment-splitting security fix from orama PR #251/review 4835288649.
Synced exactly (byte-identical from orama's source), permissions
matched to the established pattern (0755 for executable scripts, 0644
for the hooks.json.template data file).
.gitleaks.toml intentionally NOT propagated -- checked first: PT's CI
has no gitleaks job at all, so the config would be inert.
26/26 tests pass on the synced files. Confirmed a broad, pre-existing
test-suite failure (259 failures across unrelated files like
test_gossip_bus.py) predates this sync entirely -- verified via git
stash before/after comparison, not assumed -- and is out of scope for
this propagation. Hygiene clean.
* memory: dispatch-race/config-scope postmortem + 3 lessons from orama PR 260's review remediation
Postmortem (2026-08-02-dispatch-race-deferral-and-config-scope-
postmortem.md), 4 parts: the deferral-date internal-consistency bug in
the dispatch-race work; the duplicate-fallback fix and its own subtle
near-miss (a naive broader fix would have regressed a different, valid
scenario); the markdown config-scope investigation that verified a
precise fix works but surfaces 1032 pre-existing violations across 205
files, not adopted for that reason; and the completed root-cause
diagnosis of a large pre-existing test-failure count an earlier note
had only confirmed as unrelated without explaining.
3 lessons graduated, checked against existing lessons first (0 matches
on the specific patterns):
- lesson_61d719978435: verify two halves of a gated-feature commit are
actually consistent with each other via the test that exercises both,
not just each half's own coverage.
- lesson_64d1deca2fca: a duplicate-removal fix can be correct in one
code state and a regression in another -- check before removing
unconditionally.
- lesson_8bf6b00d2a44: finish the diagnosis of a confirmed-unrelated
failure count where time allows; 'pre-existing, unrelated' without
the actual cause leaves the next reader to re-investigate from
scratch.
Scanned for personal-path or workstation-identity literals before
writing -- none present; all paths described repo-relatively.
994 lessons.jsonl lines, zero duplicate IDs, all 3 mirrors confirmed.
Hygiene clean.
1 parent 72750cf commit 1319742
53 files changed
Lines changed: 4517 additions & 514 deletions
File tree
- .agent
- memory
- candidates/graduated
- episodic
- semantic
- working
- references/pr-body-grant-research-raw-2026-08-02
- .cursor/rules
- .githooks
- scripts
- cursor
- hooks
- git
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
0 commit comments