Compare commits

...
4 Commits
Author SHA1 Message Date
kiskaadee 361be919b9 docs(decisions): add ADR 0001 on persistent session mode and learning contract
- Record architectural decision adopting profile-level session mode
- Codify shared learning contract and author-driven commit interactions
2026-10-13 03:30:30 -05:00
kiskaadee bf26caa151 feat(git-commit): add author mode for learning sessions
- Support session-aware message authoring under the profile learning contract
- List facts and prompt user to author commit messages in learning mode
- Retain agent message drafting under delivery mode
- Restrict integration strategy questioning to genuine topological choices
2026-10-13 03:29:17 -05:00
kiskaadee c7016bb6a0 feat(practice): adopt profile learning contract and invariant learning mode
- State invariant execution in learning mode following profile session mode
- Align git-commit handoff with fact listing and author-driven commit authoring
2026-10-13 03:29:07 -05:00
kiskaadee bcec17f285 feat(profile): define persistent session mode and learning contract
- Add Session Mode section to profile/AGENTS.md with learning and delivery states
- Add profile/learning-contract.md defining rules for learning-mode assistance and feedback
- Wire install.sh to link learning-contract.md alongside global AGENTS.md
2026-10-13 03:29:01 -05:00
6 changed files with 151 additions and 8 deletions

No files matched your search

@@ -0,0 +1,75 @@
---
type: decision
status: accepted
project: skills
date: 2026-10-13
tags: [learning-contract, session-mode, cognitive-load, git-commit, practice]
---
# Adopt Persistent Session Mode and Learning Contract Across Skills
## Context and Problem Statement
Autonomous AI agents in the engineering workflow routinely generated finished commit messages, comprehensive journal summaries, and polished technical explanations. While structured and grammatically fluent, this generated output created a fluency illusion: the AI performed the cognitive synthesis while the engineer acted merely as a reviewer, diminishing genuine recall, understanding, and long-term retention.
How should the agent interaction model be restructured so that the engineer actively generates reasoning, practices retrieval, and builds engineering competence without eliminating high-throughput delivery when needed?
## Decision Drivers
* Preservation of cognitive effort for the learner (generation effect, retrieval practice, desirable difficulties).
* Clear boundary between empirical facts (diffs, test outputs, execution logs) and cognitive interpretation (commit rationale, conceptual synthesis).
* Deterministic session-wide state across skills without requiring agent reinvention on each turn.
* Avoidance of "AI slop": prevent AI from fabricating mastery or filling unanswered knowledge gaps.
* Low friction when time-sensitive delivery is required.
## Considered Options
* **Option 1: Ad-hoc prompts per skill execution**: Leave behavior to invocation-time user instructions (e.g. typing "don't write it for me" or relying on skill-specific defaults).
* **Option 2: Skill-local learning contracts**: Define contract files inside individual skills (e.g. `skills/practice/references/learning-contract.md`) and reference across skill boundaries.
* **Option 3: Profile-level session state and shared learning contract (Adopted)**: Define persistent `Session mode` (`learning` vs `delivery`) in `profile/AGENTS.md`, place `profile/learning-contract.md` adjacent to it, install both globally via `install.sh`, and require skills to adapt their behavior accordingly.
## Decision Outcome
Chosen option: **Option 3: Profile-level session state and shared learning contract**, because session mode must be globally authoritative, always present in context via `profile/AGENTS.md`, and enforceable across skills (`practice`, `git-commit`, `journal-builder`) without creating cross-skill dependency coupling.
### Summary of Architectural Commitments
1. **State Machine & Authority Boundary**:
- Two session states: `learning` (user writes reasoning) and `delivery` (agent drafts).
- Mode is set once per session and persists.
- Only the user may transition states ("learn" / "deliver"); the agent may suggest but never switch states unilaterally.
- Skill output must visibly display `mode: <state>`.
2. **The Write Rule & Diagnostic Feedback**:
- In `learning` mode, the agent provides facts (diff slices, file changes, test outputs) and 0-5 evidence-grounded questions. The user writes the commit messages, explanations, and architectural rationale.
- Agent feedback is strictly diagnostic (`correct`, `missing`, `wrong`, `unsupported`) against empirical evidence. Promotional judgment ("masterful", "expert") is forbidden.
- Unanswered questions remain explicitly open; the agent must not fill gaps.
3. **Assistance Levels & Evidence Separation**:
- Attempts track assistance (`independent`, `hints`, `substantial`, `shown-solution`).
- Observed events (commits, passed tests) remain distinct from competence claims.
4. **Author-Driven Git Commits**:
- `git-commit` inspects diffs and groups slices, but in `learning` mode prompts the user to draft the Conventional Commit message and only quizzes topological integration strategy when a non-trivial choice exists.
## Pros and Cons of the Options
### Option 1: Ad-hoc prompts per skill execution
* Good, because it requires zero architectural changes to existing files.
* Bad, because it suffers from prompt fatigue, inconsistent enforcement, and default drift back to AI generation.
### Option 2: Skill-local learning contracts
* Good, because it keeps files within the `skills/` directory tree.
* Bad, because other skills (`git-commit`, `document`) must import references across peer skill boundaries, creating fragile relative path dependencies and failing if a single skill is uninstalled.
### Option 3: Profile-level session state and shared learning contract (Adopted)
* Good, because `profile/AGENTS.md` is always loaded in agent context, ensuring uniform visibility and session state propagation.
* Good, because `profile/learning-contract.md` establishes a single source of truth for pedagogical invariants.
* Bad, because it introduces global configuration requirements in `install.sh` and requires manual user intervention to switch modes.
## Consequences
### Positive Consequences
* Prevents the fluency illusion by ensuring the user performs active recall and formulation.
* Eliminates AI slop in journals and commit histories by substituting AI-generated assessments with user-authored explanations and explicit gap tracking.
* Restores high-throughput drafting via a single-word mode switch ("deliver").
### Negative Consequences & Accepted Trade-offs
* Commits and learning interactions in `learning` mode take more time and cognitive effort.
* Session mode persistence in the agent prompt is subject to context-window attenuation during very long conversations, mitigated by the required `mode: <state>` banner in skill outputs.
## More Information
* **Governing Specification**: [learning-contract.md](../../profile/learning-contract.md)
* **Global Agent Profile**: [AGENTS.md](../../profile/AGENTS.md)
* **Installation Script**: [install.sh](../../install.sh)
+14
View File
@@ -174,6 +174,20 @@ if [[ -d "$(dirname "$PROFILE_TARGET")" ]]; then
cp "$profile_src" "$PROFILE_TARGET"
echo " [COPIED] AGENTS.md -> $PROFILE_TARGET"
fi
# Learning contract sits beside the profile, which references it by filename
contract_src="$SCRIPT_DIR/profile/learning-contract.md"
contract_dest="$(dirname "$PROFILE_TARGET")/learning-contract.md"
if [[ -f "$contract_dest" && ! -L "$contract_dest" ]]; then
backup_if_exists "$contract_dest"
fi
if [[ "$MODE" == "link" ]]; then
ln -sfn "$contract_src" "$contract_dest"
echo " [LINKED] learning-contract.md -> $contract_dest"
elif [[ "$MODE" == "copy" ]]; then
cp "$contract_src" "$contract_dest"
echo " [COPIED] learning-contract.md -> $contract_dest"
fi
fi
# Install agent personas
+11 -1
View File
@@ -17,6 +17,16 @@ Use the ask-question tool if available; otherwise a numbered list.
- Never run destructive git (`reset --hard`, `restore <file>`, `clean -fd`, force-push) without
my explicit yes.
- Redact secrets (tokens, keys, passwords, connection strings) from anything you print or save.
## Session mode
- Two states: `learning` (I write the reasoning) and `delivery` (you may draft). Rules:
`learning-contract.md` next to this file (source: `profile/learning-contract.md`).
- One mode per session. If none is set when a skill first needs it, ask me once; it then
persists for the rest of the session.
- Only I switch modes ("learn" / "deliver"). You may suggest a switch, never make it yourself.
- Session mode overrides any skill default. Show `mode: <state>` at the top of skill output.
## Skills and docs
- My skills live in `~/Projects/active/skills`. Edit them there, never in an installed copy.
@@ -27,7 +37,7 @@ Use the ask-question tool if available; otherwise a numbered list.
- Active codebases and workspaces resolve under:
- `~/Projects/active/` (active tools and applications)
- `~/Projects/tests/` (benchmarks, experiments, and spikes)
- `~/Homelab/Sites/` and `~/Homelab/Core/` (self-hosted services)
- `~/Homelab/` Shared space for Homelab's Core and Sites repositories
- `~/Brain/` (knowledge vault)
- `~/Config/` (system and NixOS configuration)
- When resolving a project from the commit ledger, search these workspace roots before asking the user.
+36
View File
@@ -0,0 +1,36 @@
# Learning contract
Rules for any skill with a learning mode (`practice`, `git-commit`, `journal-builder`, `document`).
The session mode itself is defined in the profile (`AGENTS.md`, "Session mode"). This file
defines what each mode means.
## Modes
- **Delivery:** the agent may draft messages, summaries, and documents. The user approves them.
- **Learning:** the agent provides facts, evidence, and questions. The user writes the reasoning.
- Use learning mode for new concepts, real decisions, hard bugs, and chosen targets. Use delivery
mode for routine or familiar work. Support should fade as a concept becomes familiar.
## Rules in learning mode
1. **The user writes the core reasoning.** This includes the explanation, the commit message,
the rationale, and the "why it works". The agent never writes it on the user's behalf.
2. **Questions come from the evidence.** Ask 0-5 questions about the actual diff, test, notes,
or submission. Prefer "why" and "what if" over "what is". Zero questions is a valid outcome.
3. **Escalate help gradually:** start with a question, then a pointer, then a short explanation,
then a demo in an unrelated example.
4. **Record assistance** with every attempt: `independent`, `hints`, `substantial`, or `shown-solution`.
5. **Give diagnostic feedback.** Check the attempt against the evidence and label each point
`correct`, `missing`, `wrong`, or `unsupported`. Then let the user revise. Never praise or rank
the user ("mastered", "masterfully").
6. **Keep gaps visible.** An unanswered question stays blank or is marked `open`. The agent does
not fill it in.
## Evidence vs assessment
- A commit, passing test, accepted submission, or finished module is **evidence**. None of these
is a claim of competence on its own.
- Keep facts apart from interpretations, and keep the user's words apart from the agent's.
## Keeping and revisiting
- The user decides what happens to each item: discard, keep, or keep and revisit (`revisit_after: YYYY-MM-DD`).
- A revisit is a **recall attempt**: the user answers before seeing the old record, then compares.
- Revisit sparingly. Prefer items solved with help or still uncertain, and space the gaps further
apart after each success.
+12 -6
View File
@@ -21,12 +21,16 @@ description: >-
reverted on its own (e.g. refactor, then feature, then tests, then docs). Flag accidental
additions: scratch files, unrelated formatting, debug code.
3. **Order** slices so each commit builds on the previous one.
4. **Draft messages** using the repo's types (`AGENTS.md`), otherwise Conventional Commits
4. **Messages.** Use the repo's types (`AGENTS.md`), otherwise Conventional Commits
(`feat`, `fix`, `refactor`, `docs`, `test`, `build`, `ci`, `chore`, ...). Match depth to
significance:
- trivial: subject only;
- several concrete changes: subject + bullet body;
- non-obvious trade-off: subject + bullets + `Rationale:` line.
significance: trivial = subject only; several changes = subject + bullets; non-obvious
trade-off = subject + bullets + `Rationale:` line.
- **Learning** (session mode, see profile). Follow the learning contract.
For each slice, list the facts: files, behavior changed, tests present or missing, risks.
Ask 0-2 questions drawn from the diff. I write the message. Review it against the diff
(type, scope, subject accuracy, overclaiming) using the contract labels, then let me revise.
Write a message for me only if I ask; if you do, record `shown-solution`.
- **Delivery.** Draft the message yourself.
5. **Gate** each slice before committing:
right repo; intended branch (not `main`/`master` unless the repo's `AGENTS.md` allows it);
staged content is only this slice; tests/build run or explicitly waived; message matches
@@ -41,8 +45,10 @@ Commit without asking only if I said so in this session, and never on `main`/`ma
the repo allows it.
## Your call
- **How to slice.** Offer 2-3 options, recommended first, each with its draft messages.
- **How to slice.** Offer 2-3 options, recommended first (draft messages only in delivery mode).
Example: "1 commit" / "2 commits: refactor + feature" / "3 commits: refactor, feature, tests".
- **Integration strategy.** Only when a real merge/rebase/cherry-pick choice exists. In learning
mode I pick a strategy and give my reason; you check the reason against the branch topology.
- **Approve each commit** before it is created.
- **What next** after the last commit: offer 2-3 actions (push, open PR, keep working, run `document`).
+3 -1
View File
@@ -12,6 +12,8 @@ description: >-
- `/practice [topic or problem]`, "teach me", "help me understand", "don't write it for me".
- Works in any repo or as a pure concept question. No curriculum needed.
- Not for urgent production failures: use `diagnose`.
- Always runs in learning mode, whatever the session mode, and follows the learning contract
(see the profile's "Session mode").
## Steps
1. Ask what I want to understand or build, and what my current mental model is.
@@ -44,4 +46,4 @@ say so. Keep each reply short and focused on the next step.
## Hands off to
- `document`: when a durable insight came out of the session.
- `git-commit`: it proposes slices and messages; I type the commit myself.
- `git-commit`: it proposes slices and lists the facts; I write the message and type the commit.