akm-cli 0.9.25-alpha.2 → 0.9.25-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -0
- package/dist/assets/prompts/reflect-feedback-framing.md +1 -1
- package/dist/assets/prompts/reflect-llm-framed-contract.md +2 -9
- package/dist/assets/prompts/reflect-llm-schema-contract.md +1 -3
- package/dist/assets/prompts/reflect-output-repair.md +1 -1
- package/dist/commands/improve/extract-cli.js +3 -2
- package/dist/commands/improve/extract.js +1 -1
- package/dist/commands/improve/reflect.js +140 -320
- package/dist/commands/improve/session-asset.js +6 -0
- package/dist/commands/proposal/validators/proposal-quality-validators.js +7 -3
- package/dist/commands/proposal/validators/proposal-validators.js +4 -5
- package/dist/core/asset/asset-serialize.js +1 -1
- package/dist/core/content-safety.js +0 -24
- package/dist/integrations/agent/prompts.js +51 -91
- package/dist/integrations/harnesses/codex/index.js +6 -11
- package/dist/integrations/harnesses/codex/session-log.js +211 -0
- package/dist/integrations/harnesses/types.js +3 -3
- package/dist/scripts/akm-migrate-node.js +258 -92
- package/dist/scripts/akm-migrate.js +258 -92
- package/docs/reference/cli.md +17 -9
- package/docs/reference/configuration.md +1 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,90 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.9.25-alpha.3] - 2026-10-04
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **akm learns from Codex sessions.** `akm proposal extract --type codex` reads
|
|
14
|
+
the rollout files Codex writes under `$CODEX_HOME/sessions` (`~/.codex/sessions`
|
|
15
|
+
by default), as it reads Claude Code's and opencode's session files. `--auto`
|
|
16
|
+
and `akm improve`'s session extraction include Codex on a machine that has
|
|
17
|
+
them, and a session is extracted once, as for the other harnesses. The model
|
|
18
|
+
sees what the person and Codex said and the tool calls and results between
|
|
19
|
+
them, without Codex's own instructions or injected context (AGENTS.md, the
|
|
20
|
+
environment, an invoked skill). The reader lists a person's sessions,
|
|
21
|
+
`codex exec` runs included. It leaves out the rollouts Codex writes for
|
|
22
|
+
subagents and its other internal agents, which are not sessions of their own, and
|
|
23
|
+
unlike a Claude Code subagent transcript it does not fold them into their
|
|
24
|
+
parent.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- **Reflect changes only an asset's `description`, `when_to_use` and title;
|
|
29
|
+
akm keeps the body byte for byte.** On 396 labelled reflect edits, those that
|
|
30
|
+
fixed a frontmatter defect and left the body alone were good 24 times in 26;
|
|
31
|
+
those that also rewrote the body were bad 175 times in 224. The reply is now
|
|
32
|
+
`confidence` and a `frontmatterPatch` of `description`, `when_to_use` and
|
|
33
|
+
`title` (each a non-empty single-line string, or `null` for no change), plus
|
|
34
|
+
`ref` when no target was given, and no body: the JSON Schema, both output
|
|
35
|
+
contracts and the repair prompt say so, and the framed reply for an endpoint
|
|
36
|
+
that rejects JSON Schema has no content markers. akm applies the patch to the
|
|
37
|
+
asset it read by rewriting only the changed keys' frontmatter lines, so every
|
|
38
|
+
other line, including a list beside a description the YAML parser cannot read,
|
|
39
|
+
stays as it was; a source whose closing `---` is fused onto a value gets no
|
|
40
|
+
proposal. A non-null `title` becomes a
|
|
41
|
+
`# <title>` heading and one blank line at the top of the body, only when the
|
|
42
|
+
body has no level-1 heading; otherwise it is ignored. A patch that changes
|
|
43
|
+
nothing, whether every field is `null` or equal to the source's, creates no
|
|
44
|
+
proposal (`no_change`); an asset that requires a `description` and has none
|
|
45
|
+
still gets one derived from its own text, as before (#636).
|
|
46
|
+
- **Reflect may answer "nothing to change."** Its prompt forbade it: "your
|
|
47
|
+
proposal must correct or add something the source lacks", "must meaningfully
|
|
48
|
+
differ" from a rejected proposal, "do not return the same content
|
|
49
|
+
unchanged", and "you MUST generate" a `when_to_use`. On the same edits, those
|
|
50
|
+
that fixed no defect were bad 86 times in 93, and those driven by negative
|
|
51
|
+
feedback 50 times in 53; most of that feedback says the asset did not help
|
|
52
|
+
with an unrelated task. One goal sentence now covers every asset type: check
|
|
53
|
+
the three fields against the body and the feedback, and return `null` for
|
|
54
|
+
each that needs no fix. The feedback caveat says that feedback about a task
|
|
55
|
+
the asset never claims to cover needs no change, and with no feedback the
|
|
56
|
+
prompt says to fix only a missing or broken field. A rejected proposal is not
|
|
57
|
+
to be proposed again, and the engine returns `null` when no other change is
|
|
58
|
+
justified.
|
|
59
|
+
- **Reflect's prompt names the frontmatter problems akm can see** (a
|
|
60
|
+
description split by a stray period or carrying an escaped quote, no
|
|
61
|
+
`when_to_use`, no title) and asks for a repair that keeps the description's
|
|
62
|
+
wording, names, numbers and paths rather than a rewrite. Without the list the
|
|
63
|
+
model fixed 51 of 122 broken descriptions and 93 of 193 missing titles; with
|
|
64
|
+
it, 120 and 189. When the feedback calls a note stale or historical, a new
|
|
65
|
+
`when_to_use` names the version or date the body records, or stays as it is.
|
|
66
|
+
On an 80-case sample of the labelled set, Claude Opus reviewers judged 64 of
|
|
67
|
+
the new reflect's 78 proposals good; the old reflect's edits in the set are
|
|
68
|
+
good 81 times in 396.
|
|
69
|
+
- **`akm proposal accept` warns about an echoed "Avoid These Patterns"
|
|
70
|
+
section instead of refusing.** Reflect keeps a body as it is, so a proposal
|
|
71
|
+
for an asset that already carries the section (a leftover of the run-only
|
|
72
|
+
prompt text) would never be accepted, and the person accepting cannot edit
|
|
73
|
+
the proposal.
|
|
74
|
+
|
|
75
|
+
### Removed
|
|
76
|
+
|
|
77
|
+
- **Everything reflect needed to rewrite a body.** The prompt's "Content
|
|
78
|
+
preservation rules" and the size bounds computed for them; the related
|
|
79
|
+
distilled lessons section and the companion-doc
|
|
80
|
+
(`knowledge/skills/<skill>/references/<topic>`) option, with the gathering
|
|
81
|
+
behind them and the `derived_from_reflect` marker it read; the size guard and
|
|
82
|
+
the truncation-marker check on reflect's output, and their review reasons
|
|
83
|
+
`reflect-size-ratio` and `reflect-truncation-leak`; the stripping of an
|
|
84
|
+
appended frontmatter block and of an echoed "Avoid These Patterns" section
|
|
85
|
+
from a body; and the restore of identity fields, which a patch cannot name.
|
|
86
|
+
The accept-time size advisory and truncation-marker block stay.
|
|
87
|
+
- **The `body-edit` review reason.** A reflect revision no longer changes the
|
|
88
|
+
body, so one the judge passed is stamped `staged` and the triage drain
|
|
89
|
+
accepts it, as before 0.9.24; with `processes.reflect.qualityGate` off it is
|
|
90
|
+
minted unstamped for the drain to decide. A proposal already deferred as
|
|
91
|
+
`body-edit` stays deferred.
|
|
92
|
+
|
|
9
93
|
## [0.9.25-alpha.2] - 2026-10-03
|
|
10
94
|
|
|
11
95
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Feedback describes what a reader found missing or wrong. It is a signal
|
|
1
|
+
Feedback describes what a reader found missing or wrong, often that the asset did not help with a task it was retrieved for. It is a signal, not a fact to insert. Change a field only when it is missing or broken, or when it claims more than the body covers, and then only to describe what the body covers. Feedback about a task the asset never claims to cover, or asking for information the asset lacks, needs no change. When the feedback says the asset is stale, outdated, superseded or historical, a `when_to_use` names the version or date the body records ("When working with the 0.1.0 client"), or stays as it is.
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
Respond with exactly this plain-text frame, with no prose or code fence around it:
|
|
2
2
|
|
|
3
3
|
{{REF_LINE}}AKM_REFLECT_CONFIDENCE: <number from 0 to 1>
|
|
4
|
-
AKM_REFLECT_FRONTMATTER_PATCH: {"description": null, "when_to_use": null}
|
|
5
|
-
AKM_REFLECT_CONTENT_BEGIN
|
|
6
|
-
<complete improved markdown body>
|
|
7
|
-
AKM_REFLECT_CONTENT_END
|
|
4
|
+
AKM_REFLECT_FRONTMATTER_PATCH: {"description": null, "when_to_use": null, "title": null}
|
|
8
5
|
|
|
9
|
-
The
|
|
10
|
-
|
|
11
|
-
The frontmatter patch must be a one-line JSON object with exactly `description` and `when_to_use`. Keep a field `null` when it should not change. Supply a non-empty string only when adding or correcting that field; AKM merges those values through its existing sanitizer.
|
|
12
|
-
|
|
13
|
-
Never include the truncation marker (the literal text `{{TRUNCATION_MARKER}}`) or any other text from outside the fenced asset content shown to you, anywhere in the body.
|
|
6
|
+
The frontmatter patch must be a one-line JSON object with exactly `description`, `when_to_use` and `title`. Keep a field `null` when it should not change; otherwise give a non-empty single-line string. `title` is the text of a level-1 heading, without the leading `#`; AKM adds it only when the body has none. AKM applies the patch to the source asset and keeps the body itself.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
Respond only through the provider's native JSON schema. {{FIELD_RULE}}
|
|
2
2
|
|
|
3
|
-
`
|
|
4
|
-
|
|
5
|
-
Never include the truncation marker (the literal text `{{TRUNCATION_MARKER}}`) or any other text from outside the quoted asset content shown to you, anywhere in `content`.
|
|
3
|
+
`frontmatterPatch` must contain exactly `description`, `when_to_use` and `title`; set a field to `null` when it should not change, or to a non-empty single-line string. `title` is the text of a level-1 heading, without the leading `#`; AKM adds it only when the body has none. AKM applies the patch to the source asset, keeps the body itself, and preserves target identity. `confidence` is your honest self-rated quality confidence from 0 to 1. Do not add prose or Markdown fences around the JSON response.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Your previous response could not be extracted using the required output contract. Reformat that response exactly once using the contract below.
|
|
1
|
+
Your previous response could not be extracted using the required output contract. Reformat that response exactly once using the contract below. Keep its proposed values as they are: do not revise or add to them. Return only the repaired envelope.
|
|
2
2
|
|
|
3
3
|
{{OUTPUT_CONTRACT}}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* akm proposal extract --type claude --session-id <id>
|
|
11
11
|
* akm proposal extract --type claude --since 24h
|
|
12
12
|
* akm proposal extract --type opencode --since 7d --dry-run
|
|
13
|
+
* akm proposal extract --type codex --since 24h
|
|
13
14
|
* akm proposal extract --auto # iterate all available harnesses
|
|
14
15
|
* akm proposal extract --type claude --location /custom/path --session-id <id>
|
|
15
16
|
*
|
|
@@ -25,12 +26,12 @@ import { akmExtract, resolveStandaloneExtractPlan } from "./extract.js";
|
|
|
25
26
|
export const extractCommand = defineJsonCommand({
|
|
26
27
|
meta: {
|
|
27
28
|
name: "extract",
|
|
28
|
-
description: "Extract durable insights from native session files (claude, opencode) and queue them as proposals.",
|
|
29
|
+
description: "Extract durable insights from native session files (claude, codex, opencode) and queue them as proposals.",
|
|
29
30
|
},
|
|
30
31
|
args: {
|
|
31
32
|
type: {
|
|
32
33
|
type: "string",
|
|
33
|
-
description: "Harness name (claude, opencode). Required unless --auto.",
|
|
34
|
+
description: "Harness name (claude, codex, opencode). Required unless --auto.",
|
|
34
35
|
},
|
|
35
36
|
"session-id": {
|
|
36
37
|
type: "string",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
4
|
/**
|
|
5
|
-
* `akm extract` — read native session logs (claude, opencode) through the
|
|
5
|
+
* `akm extract` — read native session logs (claude, codex, opencode) through the
|
|
6
6
|
* session-log harnesses, pre-filter the noise, and ask the model for
|
|
7
7
|
* memory/lesson/knowledge candidates the agent did not already save. Each
|
|
8
8
|
* candidate is queued as a proposal (`source: "extract"`), never written.
|