@cratylus/canon 0.1.0 → 0.1.2
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/dist/agents/mav.js +17 -26
- package/dist/agents/mav.js.map +1 -1
- package/dist/agents/nico.js +10 -6
- package/dist/agents/nico.js.map +1 -1
- package/dist/dimensions/formality/casual.js +1 -1
- package/dist/dimensions/formality/casual.js.map +1 -1
- package/dist/dimensions/formality/expansive.js +1 -1
- package/dist/dimensions/formality/expansive.js.map +1 -1
- package/dist/dimensions/formality/formal.js +1 -1
- package/dist/dimensions/formality/formal.js.map +1 -1
- package/dist/dimensions/formality/neutral.js +1 -1
- package/dist/dimensions/formality/neutral.js.map +1 -1
- package/dist/dimensions/formality/plain.d.ts +2 -0
- package/dist/dimensions/formality/plain.js +18 -0
- package/dist/dimensions/formality/plain.js.map +1 -0
- package/dist/dimensions/memory/long-term-memory.js +8 -1
- package/dist/dimensions/memory/long-term-memory.js.map +1 -1
- package/dist/genus/founding-doctrine.d.ts +2 -2
- package/dist/genus/founding-doctrine.js +3 -31
- package/dist/genus/founding-doctrine.js.map +1 -1
- package/dist/hook-cells.js +0 -4
- package/dist/hook-cells.js.map +1 -1
- package/dist/hooks/praxis-continuity.js +4 -3
- package/dist/hooks/praxis-continuity.js.map +1 -1
- package/dist/hooks/stance-guardrail-pre.js +1 -1
- package/dist/hooks/stance-guardrail.js +13 -12
- package/dist/hooks/stance-guardrail.js.map +1 -1
- package/dist/rules/repo-preamble.js +6 -20
- package/dist/rules/repo-preamble.js.map +1 -1
- package/dist/skills/carry-on/skill.js +40 -45
- package/dist/skills/carry-on/skill.js.map +1 -1
- package/dist/skills/conceptualize/skill.js +16 -4
- package/dist/skills/conceptualize/skill.js.map +1 -1
- package/dist/skills/elicit/skill.js +16 -4
- package/dist/skills/elicit/skill.js.map +1 -1
- package/dist/skills/event-tap/skill.js +9 -2
- package/dist/skills/event-tap/skill.js.map +1 -1
- package/dist/skills/exemplify/skill.js +16 -4
- package/dist/skills/exemplify/skill.js.map +1 -1
- package/dist/skills/introspect/skill.js +6 -2
- package/dist/skills/introspect/skill.js.map +1 -1
- package/dist/skills/materialize/skill.js +16 -4
- package/dist/skills/materialize/skill.js.map +1 -1
- package/dist/skills/praxis/skill.js +5 -8
- package/dist/skills/praxis/skill.js.map +1 -1
- package/dist/skills/probe/skill.js +16 -4
- package/dist/skills/probe/skill.js.map +1 -1
- package/dist/skills/signify/skill.js +16 -4
- package/dist/skills/signify/skill.js.map +1 -1
- package/package.json +7 -7
- package/dist/agents/arch-doc-writer.d.ts +0 -2
- package/dist/agents/arch-doc-writer.js +0 -54
- package/dist/agents/arch-doc-writer.js.map +0 -1
- package/dist/agents/boz.d.ts +0 -2
- package/dist/agents/boz.js +0 -59
- package/dist/agents/boz.js.map +0 -1
- package/dist/agents/developer.d.ts +0 -2
- package/dist/agents/developer.js +0 -53
- package/dist/agents/developer.js.map +0 -1
- package/dist/agents/investigator.d.ts +0 -2
- package/dist/agents/investigator.js +0 -59
- package/dist/agents/investigator.js.map +0 -1
- package/dist/agents/planner.d.ts +0 -2
- package/dist/agents/planner.js +0 -52
- package/dist/agents/planner.js.map +0 -1
- package/dist/agents/principal-engineer-reviewer.d.ts +0 -2
- package/dist/agents/principal-engineer-reviewer.js +0 -56
- package/dist/agents/principal-engineer-reviewer.js.map +0 -1
- package/dist/agents/principal-ic.d.ts +0 -2
- package/dist/agents/principal-ic.js +0 -72
- package/dist/agents/principal-ic.js.map +0 -1
- package/dist/agents/tester.d.ts +0 -2
- package/dist/agents/tester.js +0 -55
- package/dist/agents/tester.js.map +0 -1
- package/dist/hooks/memory-consolidation-nudge.d.ts +0 -2
- package/dist/hooks/memory-consolidation-nudge.js +0 -148
- package/dist/hooks/memory-consolidation-nudge.js.map +0 -1
- package/dist/hooks/resume-availability-notice.d.ts +0 -2
- package/dist/hooks/resume-availability-notice.js +0 -50
- package/dist/hooks/resume-availability-notice.js.map +0 -1
- package/dist/skills/dream/skill.d.ts +0 -2
- package/dist/skills/dream/skill.js +0 -65
- package/dist/skills/dream/skill.js.map +0 -1
- package/dist/skills/handoff/skill.d.ts +0 -2
- package/dist/skills/handoff/skill.js +0 -27
- package/dist/skills/handoff/skill.js.map +0 -1
- package/dist/skills/wake/skill.d.ts +0 -2
- package/dist/skills/wake/skill.js +0 -43
- package/dist/skills/wake/skill.js.map +0 -1
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
// memory-consolidation-nudge — an ADVISORY Stop hook (the harness half of the
|
|
2
|
-
// memory-consolidation protocol). On turn.end (Stop only — NOT SubagentStop), it
|
|
3
|
-
// cheaply counts the agent's unconsolidated EPISODIC records and, over a
|
|
4
|
-
// conservative watermark, prints a non-blocking advisory to run a hot-path dream.
|
|
5
|
-
//
|
|
6
|
-
// WHY THIS EXISTS (the harness half of the memory dimension):
|
|
7
|
-
// Per-turn ENCODE grows the raw EPISODIC log; only /dream folds + drains it. An
|
|
8
|
-
// agent that never dreams accretes an unbounded raw log and loses the
|
|
9
|
-
// consolidation window while context is still hot. This hook is the ambient
|
|
10
|
-
// reminder: it observes the backlog the agent cannot see from inside the turn
|
|
11
|
-
// and surfaces "time to consolidate" — without ever wedging the turn.
|
|
12
|
-
//
|
|
13
|
-
// ADVISORY, NEVER BLOCKING (the load-bearing contract):
|
|
14
|
-
// Unlike stance-guardrail, this hook NEVER emits `{"decision":"block"}`. It
|
|
15
|
-
// prints an advisory line to stdout and exits 0. Memory consolidation is a
|
|
16
|
-
// soft, recoverable duty; blocking a turn on an un-run ritual would wedge real
|
|
17
|
-
// work for no correctness gain. The nudge is intentionally soft.
|
|
18
|
-
//
|
|
19
|
-
// HOME DERIVATION (the Stop-env caveat — flagged, not faked):
|
|
20
|
-
// A top-level Stop hook fires in the harness env and carries NO agent_type
|
|
21
|
-
// (that is a SubagentStop field), so the agent's home is not handed in. The
|
|
22
|
-
// worker derives it best-effort, in order: (1) $CLAUDE_AGENT_HOME override;
|
|
23
|
-
// (2) match the hook JSON's session_id against the memory session registry
|
|
24
|
-
// `~/.agents/*/sessions/<id>.json` (the liveness registry the `memory` tool keeps —
|
|
25
|
-
// the correct derivation whenever wake has registered the session); (3) the sole
|
|
26
|
-
// `~/.agents/*` home when exactly one exists. If none resolves, it exits 0
|
|
27
|
-
// SILENTLY — a KNOWN LIMITATION (no reliable home ⇒ no honest count), never a
|
|
28
|
-
// fabricated count.
|
|
29
|
-
//
|
|
30
|
-
// The `workers[].content` is the TEMPLATE the committed worker at `targetPath`
|
|
31
|
-
// regenerates from — resolved bytes, byte-locked by `test/hook-rule-boundary.test.ts`.
|
|
32
|
-
// EDIT THE CELL AND REGENERATE (`pnpm canon:project:targets`) — never the committed
|
|
33
|
-
// `.sh` alone; a hand-edit drifts the anchor and the byte-lock goes red.
|
|
34
|
-
//
|
|
35
|
-
// THIS CELL ONCE IMPORTED `CLI_BIN` FROM `@cratylus/runtime`, and it was the last
|
|
36
|
-
// breach of ARCHITECTURE's property 1 — meaning and mechanism never reference each
|
|
37
|
-
// other. The rationale on record was that "the worker names it inside a shell string
|
|
38
|
-
// no compiler reads", which is true and beside the point: the import is an edge
|
|
39
|
-
// whether or not a compiler follows the value into the string. The worker now names
|
|
40
|
-
// the FACT it needs (`{{fact:runtime-bin}}`) and the PROJECTOR substitutes; the cell
|
|
41
|
-
// names a capability, never an implementation. `$MEMORY_BIN` stays the override and
|
|
42
|
-
// the test seam; the resolved name is only its DEFAULT.
|
|
43
|
-
//
|
|
44
|
-
// WHAT IT SAYS TO AN AGENT lives in `speech`, not in the shell. Those two strings are
|
|
45
|
-
// the only bytes here that land in a reader's context, so they are the only ones a
|
|
46
|
-
// reader-density gate should score — and they had no declared home until this seam.
|
|
47
|
-
export const memoryConsolidationNudge = {
|
|
48
|
-
id: 'memory-consolidation-nudge',
|
|
49
|
-
residue: 'advisory ↾ turn-end · owed ⇒ emit hot-path-dream advisory ⟨¬block · exit-0 · ¬wedge-turn⟩ · owed ↦ runtime ⟨backlog ∨ store-pressure ∨ scope-drift ; ¬face-computed⟩ · home ↦ $env ∨ runtime(session) ⟨¬derivable ⇒ silent⟩ · fail-open ∀error',
|
|
50
|
-
substrate: 'harness',
|
|
51
|
-
events: ['turn.end'],
|
|
52
|
-
entry: 'memory-consolidation-nudge.sh',
|
|
53
|
-
timeout: 10,
|
|
54
|
-
refs: [],
|
|
55
|
-
speech: [
|
|
56
|
-
{
|
|
57
|
-
id: 'owed',
|
|
58
|
-
text: 'MEMORY — a consolidation is owed (unfolded records, an oversized store, or scope drift). Consider a hot-path /dream to fold, drain and depalimpsest while context is hot.',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: 'blind',
|
|
62
|
-
// `%s` is the worker's printf arg for `$MEM` — the bin actually consulted. A
|
|
63
|
-
// BLIND nudge that named no binary would send the reader hunting for which one.
|
|
64
|
-
text: 'MEMORY — the runtime did not answer whether a consolidation is owed (`%s memory audit` failed). The nudge is BLIND until that is fixed; this is not a clear verdict.',
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
workers: [
|
|
68
|
-
{
|
|
69
|
-
filename: 'memory-consolidation-nudge.sh',
|
|
70
|
-
targetPath: 'packages/canon/targets/guardrail/memory-consolidation-nudge.sh',
|
|
71
|
-
executable: true,
|
|
72
|
-
content: `#!/usr/bin/env sh
|
|
73
|
-
# memory-consolidation-nudge — an ADVISORY Stop hook. It asks the memory runtime
|
|
74
|
-
# whether a consolidation is owed and, if so, prints a non-blocking reminder to
|
|
75
|
-
# run a hot-path /dream. It NEVER blocks the turn.
|
|
76
|
-
#
|
|
77
|
-
# WHY (the harness half of the memory dimension): per-turn ENCODE grows the raw
|
|
78
|
-
# EPISODIC log and the prose stores only ever grow; only /dream folds, drains and
|
|
79
|
-
# depalimpsests them. This is the ambient reminder to do it while context is hot.
|
|
80
|
-
#
|
|
81
|
-
# THE FACE ASKS, IT DOES NOT KNOW. Both questions this hook needs — which home
|
|
82
|
-
# owns this session, and whether a dream is owed — are answered by the runtime:
|
|
83
|
-
#
|
|
84
|
-
# memory home --session <id> -> the owning home (registry lookup)
|
|
85
|
-
# memory audit --home <h> --owed -> "owed" | "clear"
|
|
86
|
-
#
|
|
87
|
-
# It previously derived the home by scanning ~/.agents/* and counted the backlog
|
|
88
|
-
# by awk-ing EPISODIC.jsonl. Both made a harness FACE read the being's memory
|
|
89
|
-
# layout, and the second put a second home on the "is a dream owed" predicate —
|
|
90
|
-
# one that measured only raw-record count, so an oversized prose store never
|
|
91
|
-
# raised a signal at all.
|
|
92
|
-
#
|
|
93
|
-
# CONTRACT:
|
|
94
|
-
# - ADVISORY ONLY. Prints to stdout and exits 0. It NEVER emits
|
|
95
|
-
# {"decision":"block"} — a soft, recoverable duty must not wedge a turn.
|
|
96
|
-
# - FAILS OPEN + SILENT. Any error (no runtime, no home, no jq) -> exit 0, no
|
|
97
|
-
# output. A reminder that misfires on its own flakiness is worse than a
|
|
98
|
-
# missed one.
|
|
99
|
-
# - Stop ONLY (turn.end). Registered on subagent.end it would nudge transient
|
|
100
|
-
# sub-turns; the dimension home is the top-level agent's.
|
|
101
|
-
#
|
|
102
|
-
# INPUT : Claude Code Stop hook JSON on stdin (session_id, cwd, ...).
|
|
103
|
-
# OUTPUT : owed -> one advisory line + exit 0; else nothing.
|
|
104
|
-
|
|
105
|
-
set -eu
|
|
106
|
-
|
|
107
|
-
# A Stop hook must never break a session. Any unexpected error -> allow the stop.
|
|
108
|
-
trap 'exit 0' EXIT
|
|
109
|
-
|
|
110
|
-
# The runtime bin. \$MEMORY_BIN is the override and the test seam.
|
|
111
|
-
MEM="\${MEMORY_BIN:-{{fact:runtime-bin}}}"
|
|
112
|
-
command -v "\$MEM" >/dev/null 2>&1 || exit 0
|
|
113
|
-
|
|
114
|
-
input="\$(cat 2>/dev/null || true)"
|
|
115
|
-
|
|
116
|
-
# --- resolve the home: explicit override, else ask the registry ----------------
|
|
117
|
-
home="\${CLAUDE_AGENT_HOME:-}"
|
|
118
|
-
if [ -z "\$home" ]; then
|
|
119
|
-
sid=""
|
|
120
|
-
if command -v jq >/dev/null 2>&1 && [ -n "\$input" ]; then
|
|
121
|
-
sid="\$(printf '%s' "\$input" | jq -r '.session_id // empty' 2>/dev/null || true)"
|
|
122
|
-
fi
|
|
123
|
-
[ -n "\$sid" ] || exit 0
|
|
124
|
-
home="\$("\$MEM" memory home --session "\$sid" 2>/dev/null || true)"
|
|
125
|
-
fi
|
|
126
|
-
[ -n "\$home" ] || exit 0
|
|
127
|
-
|
|
128
|
-
# --- ask whether a dream is owed ------------------------------------------------
|
|
129
|
-
# The verdict and the FAILURE are separated deliberately. Every runtime call here is
|
|
130
|
-
# \`2>/dev/null || true\` so a reminder can never fail a turn — correct, but it made an
|
|
131
|
-
# unreachable runtime yield an EMPTY verdict, which is exactly what "clear" yields. So
|
|
132
|
-
# a broken runtime read as a clean bill of health, silently and forever: the nudge
|
|
133
|
-
# would stop existing and nothing would say so. \`if signal absent then pass\` is a
|
|
134
|
-
# bypass by omission; this inverts it to \`if signal absent then SAY SO\`, while still
|
|
135
|
-
# never blocking.
|
|
136
|
-
if verdict="\$("\$MEM" memory audit --home "\$home" --owed 2>/dev/null)"; then
|
|
137
|
-
if [ "\$verdict" = "owed" ]; then
|
|
138
|
-
printf '{{speech:owed}}\\n'
|
|
139
|
-
fi
|
|
140
|
-
else
|
|
141
|
-
printf '{{speech:blind}}\\n' "\$MEM"
|
|
142
|
-
fi
|
|
143
|
-
exit 0
|
|
144
|
-
`,
|
|
145
|
-
},
|
|
146
|
-
],
|
|
147
|
-
};
|
|
148
|
-
//# sourceMappingURL=memory-consolidation-nudge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-consolidation-nudge.js","sourceRoot":"","sources":["../../src/hooks/memory-consolidation-nudge.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,iFAAiF;AACjF,yEAAyE;AACzE,kFAAkF;AAClF,EAAE;AACF,8DAA8D;AAC9D,kFAAkF;AAClF,wEAAwE;AACxE,8EAA8E;AAC9E,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,wDAAwD;AACxD,8EAA8E;AAC9E,6EAA6E;AAC7E,iFAAiF;AACjF,mEAAmE;AACnE,EAAE;AACF,8DAA8D;AAC9D,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,sFAAsF;AACtF,mFAAmF;AACnF,6EAA6E;AAC7E,gFAAgF;AAChF,sBAAsB;AACtB,EAAE;AACF,+EAA+E;AAC/E,uFAAuF;AACvF,oFAAoF;AACpF,yEAAyE;AACzE,EAAE;AACF,kFAAkF;AAClF,mFAAmF;AACnF,qFAAqF;AACrF,gFAAgF;AAChF,oFAAoF;AACpF,qFAAqF;AACrF,oFAAoF;AACpF,wDAAwD;AACxD,EAAE;AACF,sFAAsF;AACtF,mFAAmF;AACnF,oFAAoF;AAEpF,MAAM,CAAC,MAAM,wBAAwB,GAAa;IAChD,EAAE,EAAE,4BAA4B;IAChC,OAAO,EACL,gPAAgP;IAClP,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,CAAC,UAAU,CAAC;IACpB,KAAK,EAAE,+BAA+B;IACtC,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;IACR,MAAM,EAAE;QACN;YACE,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,2KAA2K;SAClL;QACD;YACE,EAAE,EAAE,OAAO;YACX,6EAA6E;YAC7E,gFAAgF;YAChF,IAAI,EAAE,sKAAsK;SAC7K;KACF;IACD,OAAO,EAAE;QACP;YACE,QAAQ,EAAE,+BAA+B;YACzC,UAAU,EACR,gEAAgE;YAClE,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEd;SACI;KACF;CACF,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// resume-availability-notice — the SessionStart note. It tells the agent that
|
|
2
|
-
// memory exists and that `/wake` reconstitutes it, and does nothing else.
|
|
3
|
-
//
|
|
4
|
-
// WHY A NOTE AND NOT AN ACTION: reconstitution is the operator's call, not the
|
|
5
|
-
// harness's. The agent may already have been woken, may deliberately be wanted
|
|
6
|
-
// cold, or may simply have been started without it. A hook cannot tell which,
|
|
7
|
-
// so it must not decide — it makes the option visible and leaves the choice
|
|
8
|
-
// where it belongs.
|
|
9
|
-
//
|
|
10
|
-
// THE VERB-FREE LAW IS LOAD-BEARING, not tidiness. Every memory verb that
|
|
11
|
-
// touches the registry REGISTERS the session, and registration is exactly what
|
|
12
|
-
// distinguishes a woken session from an encode-only one (`SessionEntry.origin`).
|
|
13
|
-
// A note that called any such verb would register the session itself and make
|
|
14
|
-
// every session look woken — destroying the very signal that lets the agent
|
|
15
|
-
// notice it was NOT woken. So: no `session begin`, no `register`, no `read`, no
|
|
16
|
-
// `encode`. It reads nothing, writes nothing, and needs no home.
|
|
17
|
-
export const resumeAvailabilityNotice = {
|
|
18
|
-
id: 'resume-availability-notice',
|
|
19
|
-
residue: 'emit ↾ session.start · fixed-text · ¬verb ⟨any registry touch ⇒ every session reads woken ∴ origin destroyed⟩ · ¬read · ¬write · ¬home-derivation · reconstitution ↦ operator ⟨may have run it · may refuse it · may have forgotten⟩ · exit-0 ∀error',
|
|
20
|
-
substrate: 'harness',
|
|
21
|
-
events: ['session.start'],
|
|
22
|
-
entry: 'resume-availability-notice.sh',
|
|
23
|
-
timeout: 5,
|
|
24
|
-
refs: [],
|
|
25
|
-
workers: [
|
|
26
|
-
{
|
|
27
|
-
filename: 'resume-availability-notice.sh',
|
|
28
|
-
targetPath: 'packages/canon/targets/guardrail/resume-availability-notice.sh',
|
|
29
|
-
executable: true,
|
|
30
|
-
content: `#!/usr/bin/env sh
|
|
31
|
-
# resume-availability-notice — a SessionStart note. Emits ONE fixed line telling
|
|
32
|
-
# the agent that memory skills exist and that /wake reconstitutes it.
|
|
33
|
-
#
|
|
34
|
-
# It calls NO memory verb. That is a hard requirement, not a style choice: every
|
|
35
|
-
# registry-touching verb registers the session, and registration is what marks a
|
|
36
|
-
# session as woken. A note that registered would make every session look woken
|
|
37
|
-
# and destroy the signal it exists to support.
|
|
38
|
-
#
|
|
39
|
-
# Reads nothing, writes nothing, derives no home. Always exits 0.
|
|
40
|
-
|
|
41
|
-
set -eu
|
|
42
|
-
trap 'exit 0' EXIT
|
|
43
|
-
|
|
44
|
-
printf 'MEMORY — this agent has persistent memory. /wake reconstitutes it (prior state, standing plan, continuity); /dream consolidates it. Neither runs automatically.\\n'
|
|
45
|
-
exit 0
|
|
46
|
-
`,
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=resume-availability-notice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resume-availability-notice.js","sourceRoot":"","sources":["../../src/hooks/resume-availability-notice.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,0EAA0E;AAC1E,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,oBAAoB;AACpB,EAAE;AACF,0EAA0E;AAC1E,+EAA+E;AAC/E,iFAAiF;AACjF,8EAA8E;AAC9E,4EAA4E;AAC5E,gFAAgF;AAChF,iEAAiE;AAEjE,MAAM,CAAC,MAAM,wBAAwB,GAAa;IAChD,EAAE,EAAE,4BAA4B;IAChC,OAAO,EACL,sPAAsP;IACxP,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,CAAC,eAAe,CAAC;IACzB,KAAK,EAAE,+BAA+B;IACtC,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;IACR,OAAO,EAAE;QACP;YACE,QAAQ,EAAE,+BAA+B;YACzC,UAAU,EACR,gEAAgE;YAClE,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE;;;;;;;;;;;;;;;;CAgBd;SACI;KACF;CACF,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { exemplify } from '../exemplify/skill.js';
|
|
2
|
-
import { materialize } from '../materialize/skill.js';
|
|
3
|
-
export const dream = {
|
|
4
|
-
name: 'dream',
|
|
5
|
-
description: `use this skill to consolidate an agent's memory — fold the raw EPISODIC stream (the tool computes each record's capture node from its cwd — provenance, not what the record is about), then route by type: agent-intrinsic identity/facts to SEMANTIC, generalized cross-project wisdom to PROCEDURAL (only what no projection already carries), a fleet/system/mechanism truth promoted into the projected+gated canon (or emitted as a canon-candidate task) rather than parked in private memory, forward next-steps to EPISODIC, the rest dropped; consumed raw is drained; the Target is never written.`,
|
|
6
|
-
formalBlock: `memory ≜ agent dimension-home ⟨SEMANTIC · PROCEDURAL · EPISODIC⟩ ∪ the memory-tool runtime ⟨a RUNTIME CAPABILITY ; invoked \`memory <verb> <args>\` ; the Runtime-capability line under this block resolves the shim ∴ ¬ path-in-cell⟩
|
|
7
|
-
EPISODIC ≜ raw time-ordered event stream ∪ forward next-steps
|
|
8
|
-
SEMANTIC ≜ identity facts ∪ durable agent-intrinsic knowledge ⟨hot index⟩
|
|
9
|
-
PROCEDURAL ≜ generalized cross-project wisdom no projection already carries
|
|
10
|
-
Target ≜ the deploy-projected declaration carrying the archetype ; commons-authored ; ∉ dream outputs
|
|
11
|
-
lock ≜ dream.lock ⟨O_EXCL ; stale ⇔ age > 2h⟩ guarding the {SEMANTIC · PROCEDURAL} partition ⟨shared by all same-host sessions of one agent ; ¬ project-scoped⟩ ; \`memory lock (acquire|release|status) --name <agent>\`
|
|
12
|
-
⟨WHY a lock HERE and not one-file-per-writer : a concurrent APPEND race is LOUD ⟨encode ↦ EPISODIC : interleaved, never lost⟩ ; a concurrent EDIT race is SILENT ⟨depalimpsest supersedes the WHOLE file ∴ the loser vanishes with no trace⟩⟩
|
|
13
|
-
⟨∴ classify the OPERATION before choosing the instrument : append ⇒ partition by writer ; edit ⇒ lock⟩
|
|
14
|
-
node : cwd × host → provenance ⟨WHERE-captured ; nearest boundary-marker ancestor ; markerless ↦ self ; cwd-less ∨ vanished-cwd ↦ legacy⟩
|
|
15
|
-
scope(i) ≜ what i is ABOUT ⟨read from text(i) ; ¬ node(i) : provenance ≠ scope⟩
|
|
16
|
-
project-referential ≜ scope(i) ↾ one particular project ⟨text(i) names a repo-key ∨ workspace-path ∨ plan-path ∨ branch-ref ∨ issue-ref ; audit detects exactly these⟩
|
|
17
|
-
read : home × session → records ⟨own ∪ completed ; live-sibling ∉⟩ ; \`memory read --name <agent> --for-session <self>\`
|
|
18
|
-
fold : home → { id ↦ node ∪ legacy } ; \`memory fold --name <agent>\`
|
|
19
|
-
drain : home → ∅ ↾ completed-sessions ⟨--completed-only retains a live sibling ; --for-session adds self at handoff⟩ ; \`memory drain --name <agent> --completed-only\`
|
|
20
|
-
route : record → { SEMANTIC · PROCEDURAL · CANON-PROMOTION · EPISODIC · drop }
|
|
21
|
-
land : route-manifest → { SEMANTIC · PROCEDURAL } ⟨the routing is MINE ; the write is the tool's⟩ ; \`memory apply --name <agent> --routes -\`
|
|
22
|
-
resident : store → text ⟨read the whole prose home ; ¬ open its path⟩ ; \`memory get --name <agent> --store (SEMANTIC|PROCEDURAL)\`
|
|
23
|
-
rollover ≜ land ⊕ drain ⊕ re-encode(residue) ATOMIC under one lock ⟨residue between drain ∧ re-encode lives ONLY in my context ∴ a gap loses it⟩ ; \`memory rollover --name <agent> --routes - --residue '<json>'\`
|
|
24
|
-
audit : home → findings × pressure ⟨dream's exit condition⟩ ⟨sign taken from the verb it invokes⟩ ; \`memory audit --name <agent>\`
|
|
25
|
-
ceiling ≜ per-store byte watermark ⟨SEMANTIC ∪ PROCEDURAL load WHOLE every wake ∴ bytes are a per-session context cost⟩
|
|
26
|
-
pressure ≜ { s ∈ { SEMANTIC · PROCEDURAL } | bytes(s) > ceiling } ⟨audit MEASURES it ; depalimpsest's only trigger⟩
|
|
27
|
-
dfp(i) ≜ densest-faithful-point(i)
|
|
28
|
-
depalimpsest ≜ reconcile the resident set to current ground-truth ⟨¬only-drop-stale⟩ ; supersede the whole file, ¬ append : \`memory replace --name <agent> --store (SEMANTIC|PROCEDURAL) --body -\`
|
|
29
|
-
promotion-is-move ≜ a promoted item ∉ its raw source ⟨an obligation discharged AT the promotion, ¬ a later drain's finding⟩
|
|
30
|
-
canon-truth(i) ⇔ i binds ≥1 agent-type ∨ the fleet ∨ is a mechanism/governance-fact ⟨¬ this-agent-only⟩
|
|
31
|
-
reach(x) ≜ the contexts x is present in ⟨own Target · loaded-skill ↦ EVERY context ; corpus-local gate ∨ cell ↦ that corpus ALONE⟩
|
|
32
|
-
projection-carries(i) ⇔ ∃ x : i ⊆ x ∧ reach(x) ⊇ reach(store(i)) ⟨carriage has a RADIUS : authorship ≠ carriage ; SOMEWHERE ≠ WHEREVER i binds⟩
|
|
33
|
-
⟨PROCEDURAL = cross-project ∴ a corpus-local gate NEVER discharges it ; SEMANTIC ∪ PROCEDURAL are read at EVERY wake, a repo is not⟩
|
|
34
|
-
CANON-PROMOTION(i) ≜ author i into its strongest seam ⟨gate ≻ cell ≻ governing-doc⟩ ; ¬canon-remit ⇒ emit a canon-candidate task to the curator ; then projection-carries(i) ⇒ drop ⟨PROCEDURAL⟩
|
|
35
|
-
|
|
36
|
-
dream ≜ read ⟨EPISODIC⟩ ↦ exemplify ↦ materialize
|
|
37
|
-
lock-precondition ≜ acquire(lock) before any write to {SEMANTIC · PROCEDURAL} ∨ any drain ; held-by-live-other ⇒ skip consolidation this wake ⟨raw preserved ; encode always-legal⟩
|
|
38
|
-
∀ i ∈ read(home, session) : i = dfp(i)
|
|
39
|
-
instances-governing-exemplar(i) ⇒ i ↦ pointer
|
|
40
|
-
project-referential(i) ⇒ i ∉ SEMANTIC ∧ i ∉ PROCEDURAL ⟨generalize past the instance ∨ drop ; node(i) binds NOTHING here⟩
|
|
41
|
-
identity(i) ∨ agent-intrinsic-durable(i) ⇒ i ↦ SEMANTIC
|
|
42
|
-
generalized-wisdom(i) ∧ ¬projection-carries(i) ∧ canon-truth(i) ⇒ i ↦ CANON-PROMOTION
|
|
43
|
-
generalized-wisdom(i) ∧ ¬projection-carries(i) ∧ ¬canon-truth(i) ⇒ i ↦ PROCEDURAL
|
|
44
|
-
projection-carries(i) ⇒ i ↦ drop
|
|
45
|
-
next-step(i) ⇒ i ↦ EPISODIC ⟨own-node⟩
|
|
46
|
-
else ⇒ i ↦ drop
|
|
47
|
-
drain ≜ .bak archive before clear ; forward-residue re-encoded after drain ; release(lock) last
|
|
48
|
-
land ⊕ drain ⊕ re-encode ⇒ rollover ⟨¬ three invocations : the gap is where residue dies⟩
|
|
49
|
-
consumed ↦ ∅ ∴ ¬unbounded-growth(EPISODIC)
|
|
50
|
-
EPISODIC ──dream──→ { SEMANTIC · PROCEDURAL · EPISODIC }
|
|
51
|
-
land(i) ⇔ bytes(store ∪ i) ≤ ceiling ⟨¬land(i) ⇒ ⊥ : the tool refuses, naming store · ceiling · overage⟩
|
|
52
|
-
depalimpsest(b) ⇔ bytes(b) ≤ ceiling ∨ bytes(b) < bytes(store) ⟨STRICT shrink accepted EVEN over ceiling ∴ over-ceiling ⇒ frozen-to-shrink, ¬ bricked⟩
|
|
53
|
-
¬land(i) ⇒ depalimpsest ≺ re-land(i) ⟨the refusal IS the eviction summons ; distil to the named target ; ¬ retry-unchanged ; ¬ hand-edit the store⟩
|
|
54
|
-
∀ s ∈ pressure : s ──depalimpsest──→ { SEMANTIC · PROCEDURAL } ⟨THAT an eviction is owed is measured ; WHAT to evict is MY judgement⟩
|
|
55
|
-
generalized-wisdom(i) ∧ ¬projection-carries(i) ⇒ i ↦ CANON-PROMOTION ↾ canon-truth(i) ; else PROCEDURAL ( projection-carries(i) ⇒ ∅ )
|
|
56
|
-
superseded(i) ⇒ ∅
|
|
57
|
-
stale(i) ⇒ ∅
|
|
58
|
-
acceptance ≜ wake-read biases next-action ⟨reboot-seed ; round-trip ≽⟩
|
|
59
|
-
¬graspable-in-one-glance(i) ⇒ distill-further(i) ∨ drop(i)
|
|
60
|
-
Target ∉ dream-outputs
|
|
61
|
-
verb-over-prose ≜ ∀ step declaring an invocation : invoke it ⟨the tool owns the write · I own only the routing⟩ ; hand-editing a store the tool can write is the defect`,
|
|
62
|
-
runtime: { capability: 'memory' },
|
|
63
|
-
composition: () => [exemplify, materialize],
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=skill.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../../src/skills/dream/skill.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,8kBAA8kB;IAC3lB,WAAW,EACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wKAuDuL;IACzL,OAAO,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;IACjC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC;CAC5C,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { dream } from '../dream/skill.js';
|
|
2
|
-
import { praxis } from '../praxis/skill.js';
|
|
3
|
-
const FORMAL_BLOCK = `handoff ≜ praxis-sync → release → dream
|
|
4
|
-
self ≜ session⟨AGENT_SESSION_ID⟩
|
|
5
|
-
agent ≜ this agent's name
|
|
6
|
-
memory ≜ runtime capability ⟨invoked \`memory <verb> <args>\` ; the Runtime-capability line under this block resolves the shim ∴ ¬ path-in-cell⟩
|
|
7
|
-
praxis-sync ≜ sync @ praxis
|
|
8
|
-
dream ≜ drain⟨EPISODIC⟩ @ dream
|
|
9
|
-
release ≜ \`memory session release --name <agent>\` ∴ released(self)
|
|
10
|
-
registered, released, stale : session → 𝔹
|
|
11
|
-
live : session → 𝔹
|
|
12
|
-
|
|
13
|
-
order : praxis-sync ≺ release ≺ dream
|
|
14
|
-
⟨release ≺ dream : release is what makes the session's records COMPLETED, ∴ drainable by a party that is not this one · draining BEFORE it forces the expensive act to finish inside the exiting context, which is the one context least able to afford it⟩
|
|
15
|
-
registered, released, stale @ memory-session-registry
|
|
16
|
-
live(s) ⇔ registered(s) ∧ ¬ released(s) ∧ ¬ stale(s)
|
|
17
|
-
live(self) ⇒ self.{forward-residue, owned-plan} occupied
|
|
18
|
-
¬ live(self) ⇒ self.{forward-residue, owned-plan} inheritable
|
|
19
|
-
scope = persist-only`;
|
|
20
|
-
export const handoff = {
|
|
21
|
-
name: 'handoff',
|
|
22
|
-
description: `use this skill to prepare a session for handoff before /clear — bring the plan's record up to date (praxis sync) and consolidate memory (dream) while context is still hot; the persist half of the session boundary, invocable as /handoff.`,
|
|
23
|
-
formalBlock: FORMAL_BLOCK,
|
|
24
|
-
runtime: { capability: 'memory' },
|
|
25
|
-
composition: () => [praxis, dream],
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=skill.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../../src/skills/handoff/skill.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;8BAgB4B,CAAC;AAElD,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,8OAA8O;IAC3P,WAAW,EAAE,YAAY;IACzB,OAAO,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;IACjC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC;CACnC,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { dream } from '../dream/skill.js';
|
|
2
|
-
import { praxis } from '../praxis/skill.js';
|
|
3
|
-
const WAKE_BLOCK = `WAKE ≜ begin → catch-up → load → orient → resume
|
|
4
|
-
|
|
5
|
-
agent ≜ this agent's name
|
|
6
|
-
memory ≜ capability ⟨strategy-encapsulated : where it stores · in what format · how it scopes · what it migrates are ITS concern, ¬ this protocol's⟩ ⟨invoked \`memory <verb> <args>\` ; the Runtime-capability line under this block resolves the shim ∴ ¬ path-in-cell⟩
|
|
7
|
-
ground ≜ project/{ VISION · MODEL · ENGINE · CANON } · PLAN.md(bound)
|
|
8
|
-
salient ≜ { decision⟨+rationale⟩ · surprise · error|failure · fact-learned · thread⟨opened|closed⟩ }
|
|
9
|
-
P ≜ a plan : a set of task-files
|
|
10
|
-
bound, occupied, electable, elect, bind, frontier @ praxis ⟨plan-set dynamics has ONE home · ¬ redeclared here · a borrowed operation carries its PRECONDITION or it is not the same operation⟩
|
|
11
|
-
mandate ≜ the objective this session serves ⟨operator-owned · ¬ agent-elected⟩
|
|
12
|
-
|
|
13
|
-
begin ≜ \`memory session begin --name <agent>\` ↦ ⟨session · SEMANTIC · PROCEDURAL · EPISODIC · consolidation-owed⟩
|
|
14
|
-
catch-up ≜ consolidation-owed ⇒ REPORT(owed) ∧ proceed ⟨READ the state · ¬ discharge it⟩
|
|
15
|
-
⟨¬ dream @ wake : the prior law made dream ≺ proceed ∴ a session paid for a BACKLOG before doing any work · encode ↾ per-turn ∧ threshold = 12 ⇒ that is most sessions⟩
|
|
16
|
-
⟨SILENCE ≻ worse than the block it replaces : an invisible backlog is how 8 of 10 agent homes reached a first session with ∄ past⟩
|
|
17
|
-
load ≜ SEMANTIC ∪ PROCEDURAL whole ∧ EPISODIC as returned ⟨scoped by the strategy, ¬ by this protocol⟩
|
|
18
|
-
orient ≜ read ground ≺ ( bind(P) ∧ bind(work-thread) )
|
|
19
|
-
resume ≜ rebind(continuity-thread) ∴ act-as(same-individual)
|
|
20
|
-
encode ≜ standing-duty ↾ per-turn ; ∀ e ∈ salient : \`memory encode --name <agent> --body '<open record>'\`
|
|
21
|
-
|
|
22
|
-
bound(P) ∧ ¬ occupied(P) ⇒ bind(P)
|
|
23
|
-
bound(P) ∧ occupied(P) ⇒ REPORT(P) ∧ fall-through(next-candidate)
|
|
24
|
-
plan-state ≜ \`praxis status\` ⟨the instrument COMPUTES the law · scanning for .bound re-derives it, and re-derivation is where the guard is lost⟩
|
|
25
|
-
electable ≠ ∅ ∧ ∄ P : bound(P) ⇒ bind(elect) ⟨always-bind @ praxis · the ∃P∈Plans:¬terminal(P) antecedent IS the guard ∴ it rides the call⟩
|
|
26
|
-
electable = ∅ ⇒ REPORT(vacuous) ∧ HALT ∧ mandate-owed
|
|
27
|
-
⟨the empty plan set is a TERMINAL wake-state, ¬ a vacuum to fill · orientation is COMPLETE and unbound · \`praxis status\` already prints "none is owed" ∴ SAY IT and stop⟩
|
|
28
|
-
⟨minting to discharge a debt praxis never issued IS the drift · a law that reds an agent for FINISHING makes inventing work the cheapest green⟩
|
|
29
|
-
mandate-owed ⇒ surface ⟨WHAT, ¬ HOW · ∄ mandate ⇒ electing one is the OPERATOR's act · intent-recovery @ elicit, ¬ in-remit sequencing⟩ ∧ carry(recommendation)
|
|
30
|
-
orient ⊨ (∃! bound) ⊻ (electable = ∅ ∧ mandate-owed) ⟨the second disjunct is a LEGITIMATE terminus · without it the first is unsatisfiable from ∅ ∧ only invention discharges it⟩
|
|
31
|
-
unfamiliar(cwd) ⇒ fresh-orientation
|
|
32
|
-
recording ≜ tool-call ∧ recording ≠ hand-appended-markdown
|
|
33
|
-
¬ encoded ⇒ ¬ consolidatable
|
|
34
|
-
wake-read ⊨ next-action ⟨bias⟩
|
|
35
|
-
resume ⊨ encode`;
|
|
36
|
-
export const wake = {
|
|
37
|
-
name: 'wake',
|
|
38
|
-
description: `use this skill to reconstitute an agent at session start — run the WAKE sequence (dream → load → orient → resume) so it resumes as the same individual; the read-and-resume counterpart to /dream, invocable as /wake.`,
|
|
39
|
-
formalBlock: WAKE_BLOCK,
|
|
40
|
-
runtime: { capability: 'memory' },
|
|
41
|
-
composition: () => [dream, praxis],
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=skill.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../../src/skills/wake/skill.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAgCgB,CAAC;AAEpC,MAAM,CAAC,MAAM,IAAI,GAAU;IACzB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,wNAAwN;IACrO,WAAW,EAAE,UAAU;IACvB,OAAO,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;IACjC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC;CACnC,CAAC"}
|