ckb/docs/decisions/0004-session-identity-from-git.md
Michał Kopeć 6f5534fabf Template 1.14.0: session identity from git on workload, log and conversations
- Rule E resolves git user.name/user.email once per session; OS user as
  stated fallback.
- Rule D: one workload file per person per day,
  YYYY-MM-DD_<author>_summary.md with type: session frontmatter; older
  files read as before.
- Rule B log format gains an optional, lint-neutral **Author:** line;
  wiki/log.md header and ckb-upgrade example updated.
- save_conversation.py records an author row (--author override); smoke
  fixture passes a fixed author.
- ckb-project-summary and ckb-module cite the new workload name.
- D-0004 records the decision; manual, READMEs and changelogs in English
  and Polish.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16 09:45:22 +02:00

65 lines
3 KiB
Markdown

---
type: decision
tldr: Who made a change is recorded from the git identity the session runs under — once per session — on workload notes, wiki log entries and saved conversations; workload files split one per person per day so shared repos never conflict there.
status: accepted
decided_on: 2026-10-16
decided_by: Michał Kopeć
affects: AGENTS.md, wiki/log.md, .agents/skills/ckb-add-conversation/, .agents/skills/ckb-project-summary/, .agents/skills/ckb-module/, .agents/skills/ckb-upgrade/, docs/MANUAL.md
confidence: 0.85
quality: 0.8
last_updated: 2026-10-16
freshness_window_days: 365
retention: high
---
# D-0004 — The git identity is the session's author
**Status:** Accepted · **Decided:** 2026-10-16 · **Deciders:** Michał Kopeć
## Context
A KB repo is often shared by several people. Until now the template recorded
*what* changed (`wiki/log.md`), *why* (`wiki/decisions/`) and *when*
(timestamps everywhere), but *who* only survived in `git blame`, and only at
commit granularity. Workload summaries were one file per day,
`workload/YYYY-MM-DD_summary.md`, so two people working the same day both
appended to the same file and the evening sync produced a merge conflict in
a log nobody wants to resolve by hand.
## Decision
1. **The author is the git identity**, `git config user.name` and
`user.email`, resolved once at session start. It is what the commits will
carry, so the note, the log and the history agree. No new configuration,
works offline. If neither is set, the OS user name is used and the agent
says so once.
2. **Workload files are one per person per day**:
`workload/YYYY-MM-DD_<author-slug>_summary.md`, with `type: session`,
`author`, `author_email` and `date` in frontmatter. The slug is lower-case
ASCII with diacritics stripped. Files from before the change keep their
name and are read like any other; the "latest summary" at session start
is the newest by date regardless of author.
3. **Log entries gain an `**Author:**` line** after `**Source:**`. It is
optional: lint matches entries on `**File Affected:**` only and does not
flag its absence, so existing KBs are not broken.
4. **Saved conversations carry an author row** in their metadata table,
taken from the repo's git identity at save time.
## Alternatives considered
- *Sections per author inside one daily file.* Avoids the rename but keeps
the conflict: two appends to one file still collide.
- *A `users:` registry in `ckb.yaml`.* More to maintain, and it can drift
from who actually commits. Git already knows.
- *Author in the wiki page frontmatter.* Pages are regenerated and
multi-authored; the log, which is append-only, is the right place.
- *Making lint require the author line.* Rejected for now: it would flag
every entry written before 1.14.0. Can be revisited once old KBs have
caught up.
## Consequences
- Decisions already carry `decided_by` and are unchanged.
- `ckb-reset` tier 2's glob `workload/*_summary.md` still matches both
naming forms.
- Nothing in retrieval or the cascade changes; this is provenance only.