mirror of
https://github.com/lukaszraczylo/claude-adam.git
synced 2026-06-09 23:19:12 +00:00
7962e85578
Lifecycle redesign: - Each proposal records source_entries: [<ts>...] in frontmatter listing the journal timestamps that fed its cluster. - After apply/reject, skill calls adam/scripts/adam-archive.mjs which moves matching entries from journal.jsonl to journal/actioned-<id>.jsonl. - Agent reads applied/ + rejected/ frontmatter on each /reflect, builds an excluded-timestamps set, skips any leftover already-actioned entries. - cursor field in state.json is vestigial; agent ignores it. Effect: journal stays bounded by active observations. Rule changes re-evaluate the remainder without manual rewind. Race-safer for parallel sessions on shared state.json (no cursor write contention). Memory drafting: - agents/adam.md adds 'Memory drafting protocol' parallel to Skill drafting. - Memory proposals MUST contain auto-memory frontmatter (name, description, type, originSessionId) in '# Proposed change' body. - Skill enforces frontmatter check at apply time; refuses if missing. Tests: 18 -> 21. Two new tests for adam-archive happy path + no-op. Migration: existing applied proposals lack source_entries. Their backing journal entries archived as a one-time bulk migration; legacy proposals annotated with migration note.
51 lines
1.8 KiB
Bash
Executable File
51 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
DEST="${HOME}/.claude"
|
|
SRC="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
echo "ADAM installer"
|
|
echo " source: $SRC"
|
|
echo " dest: $DEST"
|
|
echo
|
|
|
|
if [ ! -d "$DEST" ]; then
|
|
echo " ! $DEST does not exist. Is Claude Code installed?"
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p \
|
|
"$DEST/hooks" \
|
|
"$DEST/agents" \
|
|
"$DEST/skills/adam-self-improvement" \
|
|
"$DEST/commands" \
|
|
"$DEST/adam/proposals" \
|
|
"$DEST/adam/applied" \
|
|
"$DEST/adam/rejected" \
|
|
"$DEST/adam/trash" \
|
|
"$DEST/adam/journal" \
|
|
"$DEST/adam/scripts" \
|
|
"$DEST/adam/tests/fixtures"
|
|
|
|
cp "$SRC/hooks/adam-observe.mjs" "$DEST/hooks/"
|
|
cp "$SRC/hooks/adam-nudge.mjs" "$DEST/hooks/"
|
|
cp "$SRC/agents/adam.md" "$DEST/agents/"
|
|
cp "$SRC/skills/adam-self-improvement/SKILL.md" "$DEST/skills/adam-self-improvement/"
|
|
cp "$SRC/commands/reflect.md" "$DEST/commands/"
|
|
cp "$SRC/adam/scripts/adam-archive.mjs" "$DEST/adam/scripts/"
|
|
cp "$SRC/adam/tests/run-tests.sh" "$DEST/adam/tests/"
|
|
cp "$SRC/adam/tests/fixtures/seed-corrections.jsonl" "$DEST/adam/tests/fixtures/"
|
|
|
|
[ -f "$DEST/adam/journal.jsonl" ] || : > "$DEST/adam/journal.jsonl"
|
|
[ -f "$DEST/adam/state.json" ] || echo '{"cursor":0,"tool_window":[]}' > "$DEST/adam/state.json"
|
|
[ -f "$DEST/adam/usage.json" ] || echo '{}' > "$DEST/adam/usage.json"
|
|
|
|
echo " files installed."
|
|
echo
|
|
echo " next steps:"
|
|
echo " 1. bash $DEST/adam/tests/run-tests.sh # must show: 21 passed, 0 failed"
|
|
echo " 2. merge settings.json.example into $DEST/settings.json"
|
|
echo " 3. start a fresh Claude Code session, then run /reflect"
|
|
echo
|
|
echo " ADAM is dormant until you invoke /reflect."
|