Skip to content

armgit / cogit

Public Imported from GitHub
0

Git for the intent behind agent-written code. Records what your coding agent decided and why, and links every commit to it.

fix(record): write only options the conversation named

Eren95ee5dbcc918
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 043d158..a6e027f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- The conversation store keeps the agent's full answer. A turn stored while the agent was still answering stayed empty or partial for good, so the map showed those messages without their answer; the next build fills in what the transcript still holds.
- `.cogit/map.html` holds its data one value per line, so a text search like `grep -r` that matches it prints far less.
+- The recorder writes only rejected options someone named in the conversation, and `agreed` only when the user approved in that message.
## [0.31.0] - 2026-11-01
### Added
diff --git a/packages/cli/skills/record/SKILL.md b/packages/cli/skills/record/SKILL.md
index 51e877e..bb434bc 100644
--- a/packages/cli/skills/record/SKILL.md
+++ b/packages/cli/skills/record/SKILL.md
@@ -55,7 +55,11 @@ transcript is unreadable: send only `status`.
- `summary`: what came of it, ONLY when `messageSummaries` is true; otherwise leave it out,
like a commit with a subject and no body.
- A decision: `decidedBy` (`"user"` or `"agreed"`), `why`, `alternatives`
- (`{ "option", "why" }`).
+ (`{ "option", "why" }`). `alternatives` lists only options someone actually named in the
+ conversation before the decision: never one inferred from the decision, never the current
+ state, and no durations, sizes or reasons the conversation does not contain. An option only
+ postponed was not rejected. `"agreed"` needs the user approving the proposal in this message;
+ a proposal the user has not answered is not a decision.
- Your work belongs to the message that caused it: `work`, `agentDecisions`
(`{ "title", "why", "alternatives" }`), `commits` (short hashes), `files` (a few paths).
Work spanning messages goes on the one it ended in; update an earlier node only to correct it.
diff --git a/packages/cli/src/commands/backfill.ts b/packages/cli/src/commands/backfill.ts
index 1cfbac6..5b60c9a 100644
--- a/packages/cli/src/commands/backfill.ts
+++ b/packages/cli/src/commands/backfill.ts
@@ -80,6 +80,8 @@ function rules(language: string, messageSummaries: boolean, recorder: RecordMode
"- parent: an earlier message id, or null when the message starts a new thread; never a topic or phase node.",
"- Back to an older thread: that message is the parent and the previous one goes in links (at most 5). Unsure: use the previous message.",
'- When the message itself made a decision (the user asked for it, picked an option or approved a proposal): decidedBy ("user" or "agreed"), the reason in why, and the options not taken in alternatives [{"option": "...", "why": "..."}].',
+ "- alternatives lists only options someone actually named in the conversation before the decision. Never infer one from the decision, never list the current state as an option, and leave the field out when none was named. Its why says what the conversation said: no durations, sizes or reasons it does not contain. An option only postponed was not rejected.",
+ '- decidedBy "agreed" needs the user approving the proposal in this message. A proposal the user has not answered is not a decision.',
'- The agent\'s work belongs inside the message node that caused it, never in nodes of its own: work (short items), agentDecisions ([{"title": "...", "why": "...", "alternatives": [...]}]) only for technical choices with a reason — never for proposals or work items — commits (short hashes) and files (a few paths).',
"- Write a branch summary ({title, asked, outcome, open}) on the first message of a branch when the branch ends.",
'- Never send "at"; the CLI takes each message\'s time from the transcript.',
diff --git a/packages/cli/test/backfill.test.ts b/packages/cli/test/backfill.test.ts
index 60fd58d..a71a29d 100644
--- a/packages/cli/test/backfill.test.ts
+++ b/packages/cli/test/backfill.test.ts
@@ -95,6 +95,8 @@ describe("catchUpPrompt", () => {
expect(prompt).toContain("The record has no nodes yet.");
expect(prompt).toContain("titles and text in Turkish");
expect(prompt).toContain("(no written reply)");
+ expect(prompt).toContain("only options someone actually named in the conversation");
+ expect(prompt).toContain("A proposal the user has not answered is not a decision.");
expect(prompt).toContain("…");
expect(prompt).toContain('{"sessionId": "s1", "nodes": [...]');
});