aidd-lint: trigger architecture (hook + home ADR) #108
Labels
No labels
P0
P1
P2
P3
bug
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#108
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
How the aidd-lint tiers actually fire (see mapping ticket). Proposal: a PostToolUse hook on Write/Edit where the file matches
**/*.mdunder plugin/prompt/reference paths. Gates: skip edits under ~20 changed words (a 5-word edit needs no lint pass); dedupe repeated edits to the same file within a session. Tier 1 (deterministic cops) runs synchronously in the hook -- fast, no model cost. Tier 2 (charter judge) runs async or batched at session end -- it costs a model call. Tier 3 is not automated: findings neither tier can classify route to a human, mirroring ADR-0048's judgment-residue -> reviewer-charter pattern.Open decision -- WHERE THIS LIVES, needs an ADR before implementation (
/os-adr:findthen/os-adr:create):Acceptance criteria
Non-goals
Verify
Edit-size gate boundary test (19 vs 21 changed words); hook fires on SKILL.md edit in a sandbox session; report lands where the chosen plugin documents.
Implemented on branch aidd-lint/tier-2 (uncommitted, pending review). hooks/hooks.json (PostToolUse Write|Edit|MultiEdit + SessionStart + SessionEnd, all fail-open exit-0), pure AiddLint::Gate — Edit = added+removed word diff, Write to tracked file = word-diff vs
git show HEAD:<path>(whole-content only for untracked; prevents lint storms on scaffolded files), threshold in top-level gate: config, 19/21 boundary tests. Scope via paths: globs (CLAUDE.md excluded v1). Session dedupe + Tier-2 queue under .cc-os/aidd-lint/, SessionStart GC sweep of orphans (gc.orphan_days), SessionEnd finalize-only — never invokes a model; Tier-2 drain is on-demand per premortem timeout/auth/cost risk. Single report.md keep-exactly-one rollover, no JSON twin. invariants.md documents four invariants incl. the Tier2::Judge seam #107 implemented against. ADR-0059 records the trigger architecture.Bonus fix: Config repo-root/config-discovery used File.directory?(".git"), always false in git worktrees — fixed (File.exist?) with regression tests; also affected DeadReferencePointer.
Open: queue-drain wiring (follow-up); bin/refresh-plugins at merge time. Suite green (151/316 with #107).
Reviewed and merged to main in
41240a8(2026-07-23).