sphica 0.6.61 → 0.6.63
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://anthropic.com/claude-code/plugin.schema.json",
|
|
3
3
|
"name": "sphica",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.63",
|
|
5
5
|
"description": "Records Claude Code and Codex sessions on your machine and keeps past implementation and decisions, with their sources, for your agent to find.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "iroha924",
|
package/dist/mcp-record.js
CHANGED
|
@@ -49170,7 +49170,8 @@ async function checkRecord(db, target, raw, facts = prepareRecord(target.root, r
|
|
|
49170
49170
|
"text",
|
|
49171
49171
|
"external_id",
|
|
49172
49172
|
"session_id",
|
|
49173
|
-
"turn_id"
|
|
49173
|
+
"turn_id",
|
|
49174
|
+
"created_at"
|
|
49174
49175
|
]).where("project_id", "=", target.projectId).where("id", "in", [...refs]).execute() : []).map((s) => [s.id, s]));
|
|
49175
49176
|
for (const r of refs) {
|
|
49176
49177
|
if (!sources.has(r))
|
|
@@ -49415,6 +49416,20 @@ async function checkRecord(db, target, raw, facts = prepareRecord(target.root, r
|
|
|
49415
49416
|
problems.push(`${key}: the AI's adoption in s${x.source} left out, so it stays a candidate: ${why}`);
|
|
49416
49417
|
adoption.splice(adoption.indexOf(x), 1);
|
|
49417
49418
|
}
|
|
49419
|
+
if (target.origin === "trace") {
|
|
49420
|
+
const newest = (ids) => {
|
|
49421
|
+
let found;
|
|
49422
|
+
for (const s of ids.map((id) => sources.get(id)))
|
|
49423
|
+
if (s?.kind === "session_message" && (!found || s.created_at > found.created_at))
|
|
49424
|
+
found = s;
|
|
49425
|
+
return found;
|
|
49426
|
+
};
|
|
49427
|
+
const adopted = newest(adoption.filter((x) => x.route !== "agent").map((x) => x.source));
|
|
49428
|
+
const proposed = newest(evidence.filter((e) => e.role === "proposes").map((e) => e.source));
|
|
49429
|
+
const midTurn = adopted && proposed?.author_kind === "assistant" && !proposed.external_id.includes(":ask:") && adopted.session_id !== null && adopted.turn_id !== null && proposed.session_id === adopted.session_id && proposed.turn_id === adopted.turn_id && await db.selectFrom("source").select("id").where("session_id", "=", adopted.session_id).where("created_at", "<", adopted.created_at).where("turn_id", "=", adopted.turn_id).executeTakeFirst() !== undefined;
|
|
49430
|
+
if (adopted && proposed && proposed.created_at > adopted.created_at && !midTurn)
|
|
49431
|
+
problems.push(`${key}: its adoption (s${adopted.id}) is older than the proposal it cites (s${proposed.id}); if the proposal changed, quote the owner's reply to the final version or leave the adoption out; keep it if the adoption is right`);
|
|
49432
|
+
}
|
|
49418
49433
|
const grounds = (["decision", "constraint"].includes(u.kind) ? adoption.find((x) => x.route !== "agent") : evidence[0])?.source ?? null;
|
|
49419
49434
|
const fields = [];
|
|
49420
49435
|
for (const f of u.fields) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sphica",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.63",
|
|
4
4
|
"description": "Records Claude Code and Codex sessions on your machine and keeps past implementation and decisions, with their sources, for your agent to find.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/skills/glean/SKILL.md
CHANGED
|
@@ -75,7 +75,7 @@ read tools `search` and `read`. Pass the repository root as `cwd` to every tool.
|
|
|
75
75
|
| Op | What it does |
|
|
76
76
|
|---|---|
|
|
77
77
|
| `add_evidence` | Cites a `source` ref or a committed `file` (path, commit, lines). `role` as in trace. When the owner reports what someone else said, add `reported_speaker`: it stays the owner's report, never that person's statement or an adoption. A file excerpt is stored with keys masked, so quote words around a key, never the key, and cite whole lines around it: a range that cuts through a private key, or leaves a key's name outside, is refused |
|
|
78
|
-
| `adopt` | The owner's (or a maintainer's) words that settle a decision or constraint. "Kimura said it was agreed" is not adoption; the owner saying "let's make it final" is |
|
|
78
|
+
| `adopt` | The owner's (or a maintainer's) words that settle a decision or constraint. "Kimura said it was agreed" is not adoption; the owner saying "let's make it final" is. When the proposal changed after a reply (narrowed, widened, or replaced), cite the reply to the final version: a reply to an earlier version does not adopt it |
|
|
79
79
|
| `anchor` / `replace_anchor` | Adds a code location, or replaces one whose code moved (`from` and `to`, citing the owner's words); the old one is kept as history with those words. A replacement carries no commit, so an implementation whose proof was the replaced anchor goes back to candidate: add an `anchor` op with `commit` in the same batch to keep it active. A `symbol` that is a key or a value Sphica masks is refused: anchor a name, or the path alone. A warning that the path is not in the working tree (with near paths), is a directory, or does not hold the symbol means fix it and check again |
|
|
80
80
|
| `retire_anchor` | Retires a code location with nothing in its place (`from`, citing the owner's words). Reads and edits are matched by path, so the record stops being shown on that file only once it has no live `applies_to` anchor on the path; retire each one, whatever its symbol. `from` names one live anchor by `path`, and `symbol` or `role` when the path holds more than one; check lists them when it cannot tell. The anchor is kept as history with the owner's words, and read shows it under retired anchors. Retiring an implementation's only code proof puts it back to candidate. In one batch, retirements run first, then replacements, then new anchors |
|
|
81
81
|
| `replace_aliases` | Replaces the record's search words (`aliases`, up to 12, each 1 to 40 characters) when search needs a word it lacks (the other language, a common term) or an alias is so broad it floods results. Search only, never evidence, so no quote; read prints the current ones, and `[]` clears them |
|
package/skills/harvest/SKILL.md
CHANGED
|
@@ -57,6 +57,8 @@ and only by saying so: "we rejected yarn", "let's keep SQLite". check refuses th
|
|
|
57
57
|
`sphica init` bound. It adopts like the owner's words anywhere, even where their association is CONTRIBUTOR
|
|
58
58
|
- The merge only shows the code went in. It is evidence for an `implementation` (with the commit message, `role: "implements"`), never adoption
|
|
59
59
|
- A resolved review thread is not agreement either
|
|
60
|
+
- When the proposal changed after a reply (narrowed, widened, or replaced), quote the owner's or a maintainer's reply to the final version;
|
|
61
|
+
a reply to an earlier version does not adopt it. When no such reply answers the final version, leave the adoption out
|
|
60
62
|
- `supersedes` and `conflicts` retire or dispute a saved record, so they need the owner's or a maintainer's words among the unit's evidence or adoption.
|
|
61
63
|
Those words have to be in the source and be the writer's own: a maintainer quoting someone else (a `>` line, a code block, words wholly
|
|
62
64
|
inside quotation marks or right between two of them) does not count, and neither does a quote that is not there
|
package/skills/trace/SKILL.md
CHANGED
|
@@ -48,7 +48,9 @@ Everything goes through Sphica's `record` MCP server (its tools are `trace_pendi
|
|
|
48
48
|
`call record_more with cursor: "..."`, the rest of its lines are read with `record_more` and that cursor, until a reply names none
|
|
49
49
|
(the same goes for `record_save`; nothing is checked or saved again by reading on). Errors refuse the save; fix and check again. Warnings say what will be
|
|
50
50
|
left out, quarantined, or kept as a candidate, and why. An anchor warning (a path not in the working tree, with near paths; a directory; a
|
|
51
|
-
symbol not in the file) means fix the anchor and check again; keep it only when you know it is right
|
|
51
|
+
symbol not in the file) means fix the anchor and check again; keep it only when you know it is right. A warning that the adoption is older
|
|
52
|
+
than the proposal it cites means look at what changed: if the proposal really changed, quote the owner's reply to the final version or leave
|
|
53
|
+
the adoption out; if the later message only explains what was already adopted, cite it as `explains`; if the adoption is right, keep it
|
|
52
54
|
5. **Save**: `record_save` with the same run and record. A run saves once. A reply that starts with `✗` saved nothing: fix the record,
|
|
53
55
|
check it, and save with the same run
|
|
54
56
|
6. **Report** to the owner what was saved, copying save's lines (active, candidate with the reason, quarantined, superseded), all of them:
|
|
@@ -112,7 +114,7 @@ The `"..."` stands for the other language's words: in this example, `"データ
|
|
|
112
114
|
| `text`, `why`, `scope_note` | In the conversation's language. `text` states the record in one sentence; `why` is the reason given, not one you infer. A dead end's `text` is a lesson another task can use: what fails, under which condition (tool, version, environment), and the cause and the way around it only when the conversation says them. Leave the specifics to the quote, the anchors, and `commands` |
|
|
113
115
|
| `evidence` | Required. `source` is a ref from context, `quote` is copied **exactly** from that message (a phrase is enough). `role`: `states`, `proposes`, `rejects`, `explains`, `implements`, `decides` (the AI's reply deciding it; see below). When the owner reports what someone else said, add `reported_speaker` |
|
|
114
116
|
| `options` | Options compared, with `outcome` `chosen` / `rejected` / `deferred` / `proposed` and the `why` given. Evidence is optional per option. A rejected option may add `reconsider_when` (when it would be worth looking at again) with `reconsider_quote` (`source`, `quote`): **only a condition the owner stated, quoting the owner's words**. Never infer one, and never take it from the AI's suggestion or from someone else's words the owner passes on (a `>` line, a code block, or words wholly inside quotation marks refuse the save). A `reconsider_quote` not found in the message refuses the save (unlike other quotes, which quarantine the record) |
|
|
115
|
-
| `adoption` | Decisions and constraints only: the words that settle it. The owner's message adopts it as the owner's decision. The AI's own reply adopts it as an AI's decision only under the rules below. The AI proposing something and the owner not objecting is not adoption; leave it out and the record stays a candidate. Words the owner quoted (`>` lines), pasted in a code block, or put wholly inside quotation marks on a line (straight or curly quotes, Japanese corner brackets, backticks) are someone else's and never adopt, and neither do words that stand right between two such marks or apostrophes: quote more of the owner's own words around them. Check reads where the words sit, not what they mean |
|
|
117
|
+
| `adoption` | Decisions and constraints only: the words that settle it. The owner's message adopts it as the owner's decision. The AI's own reply adopts it as an AI's decision only under the rules below. The AI proposing something and the owner not objecting is not adoption; leave it out and the record stays a candidate. For the owner's adoption: when the proposal changed after an owner reply (narrowed, widened, or replaced), quote the owner's reply to the final version; a reply to an earlier version does not adopt it. When no owner reply answers the final version, leave the adoption out. Words the owner quoted (`>` lines), pasted in a code block, or put wholly inside quotation marks on a line (straight or curly quotes, Japanese corner brackets, backticks) are someone else's and never adopt, and neither do words that stand right between two such marks or apostrophes: quote more of the owner's own words around them. Check reads where the words sit, not what they mean |
|
|
116
118
|
| `anchors` | Only where the record has a code location: `path` relative to the repository root, `symbol` when there is one, `role` `applies_to` (where it applies) or `evidence` (code that shows it was done; add `commit` when known). When an adopted decision or constraint governs how one existing code location behaves (keeping it as it is included), give it `applies_to` there, even if this work did not change it: delivery shows it when that file is read or edited. Confirm the path in the repository; do not infer one from a broad topic, and leave it unanchored when several places are plausible. `no_code_surface` may say why there is none. A `symbol` must be a name in the code, never a key or a value Sphica masks: such a symbol is dropped and the anchor keeps only its path (save reports it) |
|
|
117
119
|
| `commands` | Dead ends only, up to 5: a command the dead end is about, as typed, cut to the shortest part that still names the failing use (the program and the flag or option, such as `pnpm test --watch`). The first call in a later conversation that runs it, word for word on one line, is stopped once and shown the dead end. Never a bare program name, a command in quotes, two commands joined with `;`, `\|`, or `&`, or one holding a secret |
|
|
118
120
|
| `aliases` | 8 to 12 short search words in **both Japanese and English** a later reader might type: synonyms, the other language's words, abbreviations. Search only; never evidence. Not broad words that match everything (`code`, `fix`, `update`) |
|