aboutsummaryrefslogtreecommitdiff
path: root/.ai
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-14 21:47:30 -0500
committerCraig Jennings <c@cjennings.net>2026-05-14 21:47:30 -0500
commit77eaaf814ace3fdb456d9683898d5693d402b3df (patch)
tree8cac42e3953fba0983f792f6f5b27ca638c524ff /.ai
parent372fb766a91e00428abbcc521b26b546e38704c9 (diff)
downloadrulesets-77eaaf814ace3fdb456d9683898d5693d402b3df.tar.gz
rulesets-77eaaf814ace3fdb456d9683898d5693d402b3df.zip
docs(todo): start memory-sync investigation, bump audit priorities
Memory-sync [#A] TODO flipped to DOING. Added a dated work-log subheader recording what's on disk under ~/.claude/projects/ (plain files, no symlinks, no git) and the proposed fix (stow ~/.claude/projects via archsetup/dotfiles/common/). Added a VERIFY child awaiting approval on the stow approach before any moves. Side effect of the wrap-up's --sync-child-priority pass: 43 [#B] children of the [#A] "Review pass: tighten skills and rulesets after 2026-05-04 audit" parent bumped to [#A] to match the parent. Tag any of them :no-sync: if they should stay at [#B]. Archived 2026-05-14-21-43-lint-org-build-and-memory-sync-investigation to .ai/sessions/. The day shipped /lint-org as a four-commit feature across claude-templates and rulesets, then this short follow-on pass processed the line-11 src-block via /respond-to-cj-comments.
Diffstat (limited to '.ai')
-rw-r--r--.ai/sessions/2026-05-14-21-43-lint-org-build-and-memory-sync-investigation.org91
1 files changed, 91 insertions, 0 deletions
diff --git a/.ai/sessions/2026-05-14-21-43-lint-org-build-and-memory-sync-investigation.org b/.ai/sessions/2026-05-14-21-43-lint-org-build-and-memory-sync-investigation.org
new file mode 100644
index 0000000..cee2868
--- /dev/null
+++ b/.ai/sessions/2026-05-14-21-43-lint-org-build-and-memory-sync-investigation.org
@@ -0,0 +1,91 @@
+#+TITLE: Session Context — /lint-org skill build
+#+AUTHOR: Craig Jennings & Claude
+#+DATE: 2026-05-14
+
+* Summary
+
+** Active Goal
+
+Two arcs. First (main): build the =/lint-org= command end to end per the spec at =.ai/specs/lint-org-skill-spec.md= — TDD elisp script with mechanical fixers + ERT suite, a =.claude/commands/lint-org.md= orchestrator that walks judgments inline, wrap-up integration so each evening's wrap-it-up runs the mechanical pass on =todo.org=, ship across claude-templates + rulesets in 4 commits. Second (follow-on): run =/respond-to-cj-comments= against the one cj annotation on todo.org line 11 — turned out to be a clarifying note on the memory-sync TODO, investigated the actual storage layout, filed a VERIFY for the proposed stow-based fix.
+
+** Decisions
+
+- Build as a *command* (=.claude/commands/lint-org.md=) not a model-invocable skill. Convention post =aa69245= — user-invoked entry points are commands.
+- Script emits structured stdout (one summary line + plist per issue) so the command layer parses cleanly without re-running org-lint.
+- =--check= for preview, =--followups-file=PATH= for the wrap-up's deferred-judgment routing. The script handles the append itself, so wrap-up doesn't need bash glue.
+- Followups path defaults to =~/projects/work/inbox/lint-followups.org= (where daily-prep merges in) with project-local =.ai/lint-followups.org= fallback. Override via =$LINT_ORG_FOLLOWUPS=.
+- Mechanical fixers process in descending line order so additions/deletions don't perturb earlier line numbers.
+- =misplaced-heading= is conditionally mechanical: =**X.**= at line start → =*X.*= is auto-fixed; =*** Foo= inside =verbatim= markup stays judgment. Classifier checks line N and N-1 since org-lint reports the blank line *after* the offender, not the offender itself.
+- Backup before any write (=/tmp/<basename>.before-lint-pass.<timestamp>=). Skipped in =--check= mode.
+- Canonical-source procedure followed: script + workflow edits in claude-templates first, then rsync to rulesets, then commit in both (saved memory =project_ai_scripts_canonical_source.md=).
+- Lint-org walk on the live todo.org: picked option 5 (skip) for the line-11 =cj:= block warnings since the block is actually a personal-note convention, not source code — the right tool was =/respond-to-cj-comments=, not =/lint-org=.
+
+** Data Collected / Findings
+
+- org-lint result shape on emacs 30.2: =(id [marker trust msg checker])=. Marker is a propertized string of the line number (text property =org-lint-marker= holds the actual marker); checker is the =org-lint-checker= struct (=org-lint-checker-name= → symbol). =org-lint--get-line-number= doesn't exist in this version — was a wrong guess from training data.
+- org-lint's =misplaced-heading= marker points at the *blank line after* the heading-like text, not the offending line. Both the markdown-bold case and the verbatim-asterisk case behave this way. The classifier has to look at LINE-1 first, then LINE.
+- =timestamp-syntax= warning fires on bare YYYY-MM-DD timestamps without a day-name (=<2026-05-20>= → "Parsed as: <2026-05-20 Wed>"). Not in the mechanical category list; falls through to judgment.
+- =todo.org= currently has 3 lint warnings, all on line 11: =empty-header-argument=, =wrong-header-argument=, =suspicious-language-in-src-block= — all from the same =#+begin_src cj: comment= block. Left in place by user choice (option 5 in the live walk); the cj block was handled separately via =/respond-to-cj-comments=.
+- =~/.claude/projects/-home-cjennings-code-rulesets/memory/= contains four files (=MEMORY.md=, =feedback_never_guess.md=, =project_ai_scripts_canonical_source.md=, =reference_pdftools_venv.md=). Plain dir, no symlinks, no enclosing git checkout. Memory does *not* currently sync across machines. Proposed fix: stow =~/.claude/projects= via =archsetup/dotfiles/common/.claude/projects/=. Filed as a VERIFY for Craig's approval before any moves.
+- Test totals after this session: 240 pytest + 22 lint-org ERT + 23 todo-cleanup ERT = 285 green. Byte-compile clean on the new elisp.
+
+** Files Modified
+
+claude-templates (canonical, both commits pushed to =origin/main=):
+- =138f35f feat(lint-org): add script with mechanical fixers and ERT suite= — =.ai/scripts/lint-org.el= (365 lines) + =.ai/scripts/tests/test-lint-org.el= (465 lines).
+- =4eba98c docs(wrap-it-up): run lint-org on todo.org at wrap-up= — =.ai/workflows/wrap-it-up.org= new =*** Lint org files= subsection + validation-checklist line.
+
+rulesets (both pushed to =origin/main=):
+- =f5b8688 chore(ai): sync lint-org script and wrap-it-up from claude-templates= — byte-identical pull of the script, tests, and wrap-it-up section.
+- =9f62a7c feat(lint-org): add /lint-org command + file design spec= — =.claude/commands/lint-org.md= (162 lines), =.ai/specs/lint-org-skill-spec.md= (moved from =inbox/=), =todo.org= new =[#A] Build /lint-org= entry.
+- =todo.org= (uncommitted before wrap): cj-source-block on line 11 resolved via =/respond-to-cj-comments=. Parent =[#A]= memory-sync TODO flipped to =DOING=, dated work-log subheader added under it with the memory storage investigation findings, =VERIFY= child added asking for approval on the proposed stow-based sync.
+
+** Next Steps
+
+- Carryover: =/update-skills= skill, =create-documentation= skill (large, ~600 lines of research notes already drafted in todo.org), 2026-05-04 audit review pass (12 [#A] + 38 [#B] sub-items), memory-sync setup pending the =VERIFY= answer on the proposed stow approach, =[#B]= fold-claude-templates-into-rulesets, =[#B]= =make audit=.
+- =/lint-org= goes live in the next wrap-up: =.ai/workflows/wrap-it-up.org= Step 3 runs the mechanical pass on =todo.org= and routes judgments to the follow-ups file (this session's wrap is the first one to exercise it).
+- The 3 lint warnings on todo.org line 11 stay until Craig either fixes the =cj:= src-block by hand or registers =cj:= as a known org-babel language in Emacs init. Won't auto-fix.
+
+* Session Log
+
+** Startup + spec triage (13:05 CDT)
+
+Clean startup — no interrupted session, no cross-agent traffic, no reminders. Inbox had one file: =lint-org-skill-spec.md= dropped today at 12:54, a full spec for a =/lint-org= skill that wraps =org-lint=. Spec defines two modes (interactive, mechanical-only), four mechanical-fix categories (item-number, missing-language-in-src-block, misplaced-planning-info, markdown-bold), four judgment categories (link-to-local-file, invalid-fuzzy-link, verbatim-asterisk, suspicious-language), and a wrap-up integration that runs the mechanical pass on todo.org each night.
+
+Filed: moved spec to =.ai/specs/lint-org-skill-spec.md= and added =[#A] Build =/lint-org= skill + wrap-up integration= to todo.org (just before the =/update-skills= entry). Craig picked "build it now."
+
+** API probe + repo conventions
+
+Probed =org-lint= output format in =emacs --batch -Q=. Each report item is =(id [marker trust msg checker])= — the marker is a propertized string of the line number, the checker is an =org-lint-checker= struct (name is the field that identifies the category). Earlier attempt used =org-lint--get-line-number= which doesn't exist in this Emacs version (30.2); the line number is just the marker string content.
+
+Current todo.org state: 3 warnings, all on line 11, from a single =cj:= src block (empty header argument "comment", missing colon, unknown source-block language). These are =suspicious-language-in-src-block= — judgment category per the spec.
+
+Conventions confirmed:
+- Commands live in =.claude/commands/= (rulesets-only). Patterns: =start-work.md=, =review-code.md=, =respond-to-cj-comments.md=, etc.
+- Elisp scripts live in =.ai/scripts/=, canonical in =~/projects/claude-templates/=, rsync'd to rulesets per the canonical-source procedure.
+- ERT tests live in =.ai/scripts/tests/test-<name>.el=. Makefile target =test-scripts= globs =tests/test-*.el= and runs each.
+- =todo-cleanup.el= is the precedent — =lexical-binding=, =defconst= for module constants, =defvar= for state, CLI dispatch behind a =tc--cli-invocation-p= guard so =require= from tests doesn't fire it.
+
+** Build plan (in flight)
+
+Eight tasks tracked. Currently on #1 (creating this file). Next: ERT tests first (TDD), then implementation, then command file, then smoke test, then wrap-up integration, then commit/push in both repos.
+
+Key design calls:
+- It's a command, not a model-invocable skill. Convention post =aa69245=.
+- Script emits structured stdout (s-expressions or JSON-ish lines) so the command layer can walk judgments without re-parsing org-lint output.
+- For mechanical-only mode, the script applies fixes and emits remaining judgments on stdout; the command layer (or wrap-up workflow) routes them to a carry-forward file. Don't bake the carry-forward path into the script — keep routing decoupled.
+- Defer multi-file invocation. Defer the carry-forward-file location decision (spec lean: per-project =.ai/lint-followups.org= or similar; finalize during wrap-up integration).
+
+** Build complete (18:31 CDT)
+
+Tasks 1-7 done. Quick log:
+
+- =.ai/scripts/lint-org.el= shipped — 4 mechanical fixers (item-number, missing-language-in-src-block, misplaced-planning-info, misplaced-heading markdown-bold case), judgment-emission for the rest, =--check= preview mode, =--followups-file=PATH= for daily-prep handoff. Descending line-order processing so fixes don't perturb earlier line numbers.
+- =.ai/scripts/tests/test-lint-org.el= shipped — 22 ERT cases: Normal/Boundary/Error per category, idempotency for each mechanical fixer, =--check= mode, mixed-fixture integration, backup-file creation, followups-file behavior (append on judgments, no-op when none, skipped in check mode).
+- Caught two implementation bugs via the TDD loop: (1) =org-lint= reports =misplaced-heading= at the *blank line after* the offender, not the offender itself — fixer now scans LINE and LINE-1; (2) =lo-fix-misplaced-planning= wasn't positioning point before =re-search-backward= — now goes to the reported line first.
+- =.claude/commands/lint-org.md= shipped — interactive mode walks each judgment with inline numbered options (per =interaction.md=); mechanical-only mode defers via =--followups-file=. Edge cases documented.
+- =.ai/workflows/wrap-it-up.org= updated — new =*** Lint org files= subsection in Step 3 runs the script with =--followups-file=$LINT_ORG_FOLLOWUPS= defaulting to =~/projects/work/inbox/lint-followups.org=, project-local fallback. Validation checklist gained one line.
+- All canonical edits in claude-templates first, then rsync to rulesets. =make test=: 240 pytest + 22 lint-org ERT + 23 todo-cleanup ERT = 285 green.
+- Smoke against live todo.org: =--check= reports 3 judgments on line 11 (the =cj:= src block — empty-header-argument, wrong-header-argument, suspicious-language), file MD5 unchanged. End-to-end smoke on a synthetic fixture: 4 mechanicals applied correctly, 1 judgment emitted, backup landed in =/tmp/=.
+
+Task 8 (commits in both repos) — pausing here to confirm before pushing.