Skip to content

About

Reverse grill-me AI agent skill for developer-AI knowledge alignment: Apache-inspired human accountability, high-school-clear teaching, pluggable RAG memory, and animated learning analytics.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Knowledge Alignment (knowledge_alignment)

Reverse /grill-me for AI-Assisted Engineering — Comprehension Over Output

Close the comprehension gap between developers and AI coding harnesses with Apache-inspired human accountability, high-school-clear Feynman teaching, anti-buzzword reverse-grilling, pluggable RAG memory, and animated learning analytics.

License: Apache-2.0 Apache Way: Human Accountability Agent Skills Open Standard Python 3.10+ Zero Core Dependencies

Python Rust Go TypeScript C++ Java SQL Shell

Claude Code Antigravity Codex Cursor Obsidian ChromaDB LanceDB Mem0 / MCP

Why? • Apache Certificate • Language Stack SVGs • Adaptive Loop • Quickstart • RAG Memory • Analytics • Transcripts


Visual Showcase

Developer-AI Knowledge Alignment Growth Curves

Apache-Inspired Human Stewardship Attestation Certificate

(Also open the zero-dependency interactive playback dashboard assets/demo-dashboard.html locally in any browser to scrub session-by-session through Understanding, Efficiency, ROI, Radar, and Debt Burndown curves.)


Why Knowledge Alignment?

Modern AI coding harnesses can generate an LSM-tree compactor, an OAuth2 PKCE handshake, or a distributed rate limiter in seconds—leaving behind Black-Box Debt: code that passes unit tests today, yet nobody on the team can explain, debug, or defend tomorrow.

/grill-me interviews the developer before design; knowledge-alignment flips /grill-me around. After the AI finishes a substantive change, it teaches like a great high-school teacher (zero unanchored buzzwords) and interviews the developer one open-ended question at a time until genuine causal understanding is verified.

Rooted in the Apache Way: "Comprehension Over Output"

Inspired directly by the Apache Software Foundation (ASF) Generative Tooling Guidance ("Community Over Code") and contribution policies pioneered across Apache Airflow, Apache Arrow, and Apache DataFusion:

Principle What It Enforces
Human Accountability "The AI wrote it" is never an acceptable defense. AI tools have zero governance standing; the human engineer owns correctness, security, and maintainability.
Zero AI Dumps Never pass unvetted LLM output to teammates or impose a "maintainer tax" by forcing reviewers to debug code the author does not understand.
Call Out Unknowns Openly If a deadline forces an explicit skip or defer, log Knowledge Debt so reviewers know exactly where to focus scrutiny.
Earned Human Sign-Off Disclose AI strictly via Generated-by:; reserve Signed-off-by: and Co-authored-by: exclusively for accountable human beings.

Apache Human Stewardship Certificate & Attestation (ka attest)

When a session passes alignment—or logs explicit Knowledge Debt—ka attest emits both a structured 5-section ASF / Airflow / DataFusion / Arrow PR Attestation and an embeddable GitHub-safe SVG Stewardship Certificate with a deterministic SHA-256 verification fingerprint:

ka attest \
  --ledger examples/demo-ledger.jsonl \
  --project storage-engine \
  --human "mola" \
  --email "229602071+Mola-maker@users.noreply.github.com" \
  --ai-tool "Claude Code" \
  --format both \
  --svg assets/demo-apache-certificate.svg
Preview: Certificate Automatically Shifts to DEBT DISCLOSED When Open Knowledge Debt Exists (rag-service)

Apache-Inspired Human Stewardship Certificate with Open Knowledge Debt

Preview: Full Markdown Attestation & Git Commit Trailers Emitted by ka attest --format both
## Generative AI Tooling Disclosure & Human Stewardship Attestation

### 1. Generative Tooling Disclosure (ASF / Apache Airflow Style)
- **Was generative AI tooling used in preparing this change?** Yes (`Claude Code`)
- **Scope assisted by AI vs. human stewardship**: Drafted initial code/design structures for LSM-Tree Compaction (`storage/lsm.rs`), MVCC Snapshot Isolation (`tx/mvcc.java`), Lock-Free SPSC Ring Buffer (`runtime/ring_buffer.rs`), Backpressure Bounded Queue (`runtime/backpressure.go`); the human author audited logic end-to-end, verified invariants, and trimmed boilerplate.

### 2. End-to-End Human Comprehension & Alignment Proof (Apache DataFusion Style)
| Concept | Domain | Tier | Feynman Score | Anti-Buzzword | Defensible Invariant / Trade-Off |
| :--- | :--- | :---: | :---: | :---: | :--- |
| LSM-Tree Compaction | algorithms | Tier 2 | 4.0/5 | PASS | `lsm.rs:LeveledCompactor` merges overlapping SSTables and preserves tombstones until bottommost level. |
| Backpressure Bounded Queue | concurrency | Tier 2 | 5.0/5 | PASS | `backpressure.go` enforces bounded channel capacity with `select` timeout. |

### 3. Explicitly Called-Out Unknowns & Open Knowledge Debt
- **None** — all substantive AI-assisted changes passed human reverse-grill alignment.

### 4. Anti-Maintainer-Tax & Provenance Hygiene Checklist (Apache Arrow / ICLA Style)
- [x] **Human Accountability**: I understand the core ideas and code paths end-to-end and accept sole responsibility (*"the AI wrote it"* is never a defense).
- [x] **No AI Dump / Reviewer Bandwidth Respected**: Redundant LLM boilerplate, verbose filler comments, and speculative fluff have been audited and trimmed.
- [x] **Originality & License Provenance**: Verified no undisclosed third-party or license-incompatible code was introduced.
- [x] **Human-Only Attribution**: Generative AI is disclosed strictly via `Generated-by:` and excluded from `Signed-off-by:` and `Co-authored-by:`.

### 5. Commit Trailers
Generated-by: Claude Code
Knowledge-Aligned: LSM-Tree Compaction (Feynman 4.0/5, 2r, ref:ka-evt-demo06)
Knowledge-Aligned: Backpressure Bounded Queue (Feynman 5.0/5, 1r, ref:ka-evt-demo16)
Knowledge-Debt: none
Signed-off-by: mola <229602071+Mola-maker@users.noreply.github.com>

Programmatic Attribution Guardrail: ka attest validates human names and Co-authored-by: entries against AI agent/model identifiers (Claude, GPT, Gemini, Copilot, Cursor, Codex, etc.) and exits cleanly with status 1 if anyone attempts to assign human sign-off to an AI.


Multi-Language Stack SVGs (ka render --stacks-dir)

Every alignment event automatically resolves its language stack via --language or touched file extensions across Python, Rust, Go, TypeScript, C++, Java/JVM, SQL, and Shell, generating both a full overview matrix and standalone per-language SVG badge cards:

Multi-Language Stack Knowledge Alignment Matrix

Embeddable Per-Language SVG Badge Cards

TypeScript Knowledge Alignment Card Python Knowledge Alignment Card
Rust Knowledge Alignment Card Java Knowledge Alignment Card
C++ Knowledge Alignment Card Go Knowledge Alignment Card
ka render --ledger examples/demo-ledger.jsonl --svg-dir assets --stacks-dir assets/stacks

How the Adaptive 3-Tier Loop Works

flowchart TD
    A["AI Completes Coding / Design Task"] --> B["Phase 0: Memory Recall (ka recall)"]
    B --> C{"Phase 1: Complexity Triage"}
    C -->|"Tier 0: Typos / Formatting / 1-line config"| D["Exempt — Finish Cleanly"]
    C -->|"Tier 1: Clear Bugfix / Helper"| F["Phase 3: Direct Reverse-Grill (1-2 Qs)"]
    C -->|"Tier 2: Algorithms / Architecture / Concurrency / Security"| E["Phase 2: Teach-First (4-Step + Two-Layer Card)"]
    E --> F
    F -->|"Buzzword / Gap Detected"| G["Targeted Plain-Language Micro-Remediation"]
    G --> F
    F -->|"Explicit 'skip' or 'defer'"| H["Log Knowledge Debt (ka defer)"]
    F -->|"Causal Understanding Verified"| I["Log Alignment (ka log) & Sync RAG Memory"]
    H --> J["Phase 4: Apache Endorsement & Certificate (ka attest)"]
    I --> J
Loading

Teaching Like a Great High-School Teacher (4-Step + Two-Layer Card)

For Tier 2 tasks, pedagogy-playbook.md enforces Zero Unanchored Jargon:

  1. The Friction: Why the obvious/naive solution fails under real constraints.
  2. Layer 1 — High-School Intuition: Build an everyday mental model before naming technical terms.
  3. Concrete Toy Walkthrough: Hand-trace 3–5 small inputs step-by-step with an ASCII or Mermaid diagram.
  4. Layer 2 — Intuition <-> Engineering Map: Map each plain-English step directly to exact files, symbols, and engineering trade-offs.

Quickstart & Multi-Harness Installation

1. Install the Open Agent Skill (npx skills)

Works with Claude Code, Antigravity, Codex, Cursor, Gemini CLI, and any Open Agent Skills harness:

npx skills add Mola-maker/knowledge_alignment --yes
# Or install globally across all workspaces:
npx skills add Mola-maker/knowledge_alignment -g --yes

2. Run the Zero-Dependency Python CLI (ka)

Requires Python 3.10+ with zero required runtime dependencies:

python3 skills/knowledge-alignment/scripts/ka.py --help

# Optional editable install for global `ka` command
pip install -e .
ka init --backend local --human "Your Name" --email "you@example.com"

Optional extras for vector RAG backends and Pillow GIF export:

pip install -e ".[gif]"                 # Animated GIF & PNG export
pip install -e ".[chroma,lancedb,mem0]" # Vector & personalized RAG backends

3. Layered Enforcement (Soft Skill -> Always-On Rules -> Hard Stop Gate)

Layer Mechanism Harness Support Path
Layer 1 — Skill Protocol Post-task triage, pedagogy & reverse-grill spec All Open Agent Skills harnesses skills/knowledge-alignment/SKILL.md
Layer 2 — Always-On Rules Mandatory workspace/global instruction templates AGENTS.md, CLAUDE.md, GEMINI.md, Cursor .mdc adapters/rules/
Layer 3 — Hard Stop Hook Blocks completion (exit 2) if substantive git edits lack a recent alignment/deferral entry Claude Code, Antigravity hooks adapters/hooks/stop_gate.py

Personal Memory & Pluggable Open-Source RAG Backends

Stop forcing the AI to re-explain fundamentals you already mastered—and automatically surface open Knowledge Debt when revisiting deferred modules.

Backend Mode Underlying Open-Source Stack Best For
local (default) Built-in CLI Markdown cards + pure-Python Okapi BM25 (k1=1.5, b=0.75) Zero-dependency offline recall
obsidian Built-in CLI Obsidian Vault notes ([[wikilinks]], callouts, YAML) + NotebookLM/QMD bundle export Visual PKM knowledge graph & NotebookLM
chroma Optional Extra chromadb.PersistentClient local semantic vector collection Paraphrased conceptual recall
lancedb Optional Extra lancedb.connect serverless columnar vector table High-speed disk vector storage
mem0 Optional Extra mem0.Memory / mem0.MemoryClient (add/search) Cross-session personalized memory
MCP Servers Config Templates @modelcontextprotocol/server-memory, OpenMemory, Cognee, Graphiti Native tool-level RAG inside any MCP harness
ka init --backend obsidian --obsidian-vault ~/Documents/MyVault
ka recall --query "bloom filter tombstones"
ka export-obsidian --bundle-dir ./notebooklm-sources

See adapters/mcp/ and references/rag-and-memory-guide.md for full configuration templates.


Quantified Metrics & Three-in-One Visualizations

No tedious end-of-session surveys—metrics are computed objectively from every alignment session (exact formulas):

  • Understanding Index (0–100): Feynman depth (0–5), first-pass alignment rate, and anti-buzzword pass rate.
  • Alignment Efficiency (0–100): Rounds-to-alignment decay, remedial re-teaching drop, and comprehension pace.
  • Alignment ROI (0–100): Black-Box Debt eliminated (aligned / (aligned + open_debt)), concept reuse across tasks, and Knowledge Debt burndown.

Knowledge Debt Burndown and Domain Mastery

Animated Knowledge Alignment Journey

# Terminal sparkline trend report
ka report --ledger examples/demo-ledger.jsonl

# Export interactive HTML dashboard (with Timeline Playback!), SVGs, stack cards, GIF & PNG
ka render --ledger examples/demo-ledger.jsonl \
  --svg-dir assets \
  --stacks-dir assets/stacks \
  --html assets/demo-dashboard.html \
  --gif assets/demo-alignment-journey.gif \
  --png assets/demo-summary.png

Worked Dialogues & Repository Map

knowledge_alignment/
├── skills/knowledge-alignment/   # Open Agent Skills package (SKILL.md, references/, scripts/ka.py)
├── adapters/                     # Always-on rules, Stop Hook gate, MCP templates, Apache PR template
├── knowledge_alignment/          # Zero-dep Python core (ledger, provenance, stacks, memory/, analytics, visualize/)
├── examples/                     # Worked transcripts + 16-session multi-language demo ledger
├── assets/                       # Apache certificate SVGs, language stack cards (assets/stacks/), animated SVGs/GIF & HTML dashboard
└── tests/                        # Pure-stdlib unittest suite

License

Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.

About

Reverse grill-me AI agent skill for developer-AI knowledge alignment: Apache-inspired human accountability, high-school-clear teaching, pluggable RAG memory, and animated learning analytics.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages