Skip to content

feat: injection-proof activity graph in cch view + technical-writer support (v0.9.1)#38

Open
Shreyan1 wants to merge 2 commits into
mainfrom
feat/injection-proof-and-writer-support
Open

feat: injection-proof activity graph in cch view + technical-writer support (v0.9.1)#38
Shreyan1 wants to merge 2 commits into
mainfrom
feat/injection-proof-and-writer-support

Conversation

@Shreyan1

Copy link
Copy Markdown
Owner

The ultimate transparency test

Injection previously left no durable trace. This PR records every real injection and shows it.

  • events.jsonl: one metadata line per prompt where the UserPromptSubmit hook actually returned learned context (timestamp, tool, session, habit/memory counts, scope). Separate from log.jsonl on purpose: every log.jsonl consumer assumes one line = one captured edit. Fail-open, rotation-capped, self-describing header.
  • cch view activity graph: capture vs injection bars for the last 14 days plus a last-injected proof line pointing at the append-only file. Renders only real logged events.

Technical-writer support

  • Repo scan samples article .md/.mdx pages (README and instruction docs excluded) so an existing docs corpus seeds house style cold.
  • Both extraction prompts name writing conventions (heading case, voice/person, callouts, frontmatter, UI-term formatting) as first-class habits.
  • Injection wrapper now reads 'code or documentation'.
  • Verified live on a docs repo: scan learned YAML-frontmatter, second-person voice, bold-UI-terms, and Note-callout habits; they graduated and injected.

Hardening

  • Habit rules quoting the extraction prompt's own instruction text (observed with llama3.2:1b) are dropped at parse, mirroring the memory-side few-shot echo guard.

Version 0.9.1 · 1052 tests green · lint clean

🤖 Generated with Claude Code

…upport

Injection previously left no durable trace: the UserPromptSubmit hook built
and returned context but recorded nothing, so 'is it actually injecting?'
was unanswerable. Now every prompt that returns learned context appends one
metadata line (timestamp, tool, session, habit/memory counts, scope) to
events.jsonl, fail-open and rotation-capped like log.jsonl but in its own
file so no log.jsonl consumer's 'one line = one captured edit' assumption
changes. cch view renders it as a capture-vs-injection activity graph with
a last-injected proof line.

Writer support: repo scan now samples article .md/.mdx pages (instruction
docs and README excluded) so a docs corpus seeds house style cold; both
extraction prompts name writing conventions (heading case, voice, callouts,
frontmatter) as first-class habits; the injection wrapper says 'code or
documentation'. Verified live: a docs repo scan learned frontmatter shape,
second-person voice, bold-UI-terms, and Note-callout habits, which then
graduated and injected.

Also: habit rules that quote the extraction prompt's own instruction text
(llama3.2:1b echoing 'Single Declarative Sentence') are dropped at parse,
mirroring the memory-side few-shot echo guard.

Version 0.9.1. 1052 tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread src/storage.ts Fixed
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants