cairn-ai 0.2.6 → 0.2.7

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.
Files changed (65) hide show
  1. package/.agents/workflows/cairn-memory.md +1 -1
  2. package/.agents/workflows/cairn-plan.md +2 -2
  3. package/.agents/workflows/cairn-review.md +1 -1
  4. package/.agents/workflows/cairn-work.md +3 -3
  5. package/.claude/agents/explorer.md +1 -1
  6. package/.claude/agents/worker.md +1 -1
  7. package/.claude/commands/cairn-memory.md +1 -1
  8. package/.claude/commands/cairn-plan.md +1 -1
  9. package/.claude/commands/cairn-review.md +1 -1
  10. package/.claude/commands/cairn-work.md +1 -1
  11. package/.codex-plugin/plugin.json +1 -1
  12. package/README.de.md +3 -2
  13. package/README.es.md +3 -2
  14. package/README.fr.md +3 -2
  15. package/README.ja.md +3 -2
  16. package/README.ko.md +7 -6
  17. package/README.md +5 -6
  18. package/README.pt.md +3 -2
  19. package/README.zh.md +3 -2
  20. package/agents/worker.md +1 -1
  21. package/commands/cairn-install.md +2 -1
  22. package/commands/cairn-memory.md +1 -1
  23. package/commands/cairn-plan.md +2 -2
  24. package/commands/cairn-review.md +1 -1
  25. package/commands/cairn-work.md +3 -3
  26. package/docs/model-guidance/README.md +4 -4
  27. package/docs/model-guidance/claude.md +1 -1
  28. package/docs/model-guidance/codex.md +2 -2
  29. package/package.json +4 -2
  30. package/scripts/cairn-cleanup.mjs +12 -6
  31. package/scripts/cairn-goal-cli.mjs +233 -0
  32. package/scripts/cairn-goal-evidence.mjs +179 -0
  33. package/scripts/cairn-goal-operations-evidence.mjs +124 -0
  34. package/scripts/cairn-goal-operations-mutations.mjs +63 -0
  35. package/scripts/cairn-goal-operations.mjs +177 -0
  36. package/scripts/cairn-goal-policy.mjs +33 -0
  37. package/scripts/cairn-goal-state-validation.mjs +199 -0
  38. package/scripts/cairn-goal-state.mjs +89 -0
  39. package/scripts/cairn-goal.mjs +32 -1078
  40. package/scripts/cairn-lifecycle-commands.mjs +200 -0
  41. package/scripts/cairn-lifecycle-config.mjs +149 -0
  42. package/scripts/cairn-lifecycle-integrity.mjs +218 -0
  43. package/scripts/cairn-lifecycle-legacy.mjs +142 -0
  44. package/scripts/cairn-lifecycle-lock.mjs +205 -0
  45. package/scripts/cairn-lifecycle-mirror.mjs +91 -0
  46. package/scripts/cairn-lifecycle-staging.mjs +152 -0
  47. package/scripts/cairn-lifecycle-transaction-journal.mjs +210 -0
  48. package/scripts/cairn-lifecycle-transaction-targets.mjs +119 -0
  49. package/scripts/cairn-lifecycle-transaction.mjs +12 -0
  50. package/scripts/cairn-lifecycle.mjs +103 -1185
  51. package/scripts/cairn-paths.mjs +35 -5
  52. package/scripts/cairn-safe-fs.mjs +61 -35
  53. package/scripts/cairn-state-context.mjs +148 -0
  54. package/scripts/cairn-state-hook.mjs +24 -0
  55. package/scripts/cairn-state-init.mjs +137 -0
  56. package/scripts/cairn-state.mjs +6 -286
  57. package/scripts/cairn-toolcheck-detect.mjs +229 -0
  58. package/scripts/cairn-toolcheck-runtime.mjs +178 -0
  59. package/scripts/cairn-toolcheck.mjs +79 -424
  60. package/scripts/cairn.mjs +17 -3
  61. package/skills/cairn-memory/SKILL.md +1 -1
  62. package/skills/cairn-plan/SKILL.md +3 -3
  63. package/skills/cairn-review/SKILL.md +1 -1
  64. package/skills/cairn-work/SKILL.md +4 -4
  65. package/scripts/cairn-state.sh +0 -167
@@ -1,167 +0,0 @@
1
- #!/bin/sh
2
- set -eu
3
-
4
- event="${1:-manual}"
5
- root="${HARNESS_REPO_ROOT:-$(pwd)}"
6
- locale="${LC_ALL:-${LC_MESSAGES:-${LANG:-en}}}"
7
-
8
- mkdir -p "$root/docs/memory" "$root/docs/plan"
9
-
10
- memory="$root/MEMORY.md"
11
- plan="$root/PLAN.md"
12
-
13
- is_ko() {
14
- case "$locale" in
15
- ko*|KO*) return 0 ;;
16
- *) return 1 ;;
17
- esac
18
- }
19
-
20
- if [ ! -f "$memory" ]; then
21
- if is_ko; then
22
- cat > "$memory" <<'EOF'
23
- # MEMORY
24
-
25
- 이 파일은 지속적으로 필요한 저장소 지식의 짧은 색인입니다.
26
-
27
- ## Domain Knowledge
28
-
29
- - 자세한 기록은 `docs/memory/` 아래에 연결합니다.
30
-
31
- ## Policy
32
-
33
- - 구현 전에는 저장소를 정확히 탐색합니다.
34
- - 고유명사, 파일 이름, 변수 이름, 서비스 이름, 알림 이름, MCP 도구 이름, 에이전트 이름은 쓰인 그대로 보존합니다.
35
- - 현재 작업에 필요한 상세 메모리 파일만 읽습니다.
36
- - 사용자가 다른 언어를 요청하지 않는 한, 사용자에게 보이는 응답과 생성 또는 갱신하는 문서, 계획, 메모리 산출물은 OS locale 언어로 작성합니다.
37
-
38
- ## Update Rules
39
-
40
- - 루트 파일은 짧게 유지합니다.
41
- - 자세한 도메인 지식은 `docs/memory/<domain>.md`로 옮깁니다.
42
- - 사실은 출처 경로, 명령, 관찰된 동작과 함께 기록합니다.
43
- EOF
44
- else
45
- cat > "$memory" <<'EOF'
46
- # MEMORY
47
-
48
- This file is a short index of persistent repository knowledge.
49
-
50
- ## Domain Knowledge
51
-
52
- - Link detailed notes under `docs/memory/`.
53
-
54
- ## Policy
55
-
56
- - Prefer precise repository exploration before implementation.
57
- - Preserve proper nouns, file names, variable names, service names, alert names, MCP tool names, and agent names exactly as written.
58
- - Read only the detailed memory files needed for the current task.
59
- - Write user-visible responses and generated or updated documentation, plans, and memory artifacts in the OS locale unless the user asks for another language.
60
-
61
- ## Update Rules
62
-
63
- - Keep root files short.
64
- - Move detailed domain knowledge to `docs/memory/<domain>.md`.
65
- - Record facts with source paths, commands, and observed behavior.
66
- EOF
67
- fi
68
- fi
69
-
70
- if [ ! -f "$plan" ]; then
71
- if is_ko; then
72
- cat > "$plan" <<'EOF'
73
- # PLAN
74
-
75
- 이 파일은 진행 중이거나 완료된 작업 계획의 짧은 색인입니다.
76
-
77
- ## Active Plans
78
-
79
- - 상세 계획은 `docs/plan/` 아래에 연결합니다.
80
-
81
- ## Completed Plans
82
-
83
- - 완료된 주제는 증거 링크와 함께 이곳으로 옮깁니다.
84
-
85
- ## Planning Rules
86
-
87
- - 프로젝트 루트 `MEMORY.md`가 있으면 먼저 읽고, 없으면 저장소 메모리 없이 계속 진행합니다.
88
- - 비단순 구현 또는 계획된 작업 재개는 먼저 `triage-plan`이 active인 계획을 쓰거나 복원하고 탐색 전에 동기화합니다. 대상이 확정된 Git/GitHub 운영은 코드 수정·충돌 해결·파괴적 복구·릴리스/배포·설계가 필요하지 않으면 plan/goal 없이 실행합니다.
89
- - 계획은 구현 전에 의사결정이 완료된 상태여야 합니다.
90
- - 에이전트, 플러그인, 위임 워크플로 지침을 적용하기 전에 복잡도 트리아지를 실행합니다.
91
- - 선택한 Light Path 또는 Heavy Path와 확인한 Heavy Path 신호를 `docs/plan/<topic>.md`에 기록합니다.
92
- - 구현은 작은 모듈 작업으로 나눕니다.
93
- - 구현 전에 저장소 스택과 필요한 LSP/check 도구를 감지합니다.
94
- - 필요한 도구가 없으면 사용할 수 없다고 판단하기 전에 설치 또는 부트스트랩을 시도합니다.
95
- - 각 작업은 보통 정확히 두 게이트를 통과합니다.
96
- - 모듈 수용 검증.
97
- - 표면 통합 검증.
98
- - 외부 상태 변경 전에는 가능한 경우 dry-run 또는 check mode를 실행합니다.
99
- - 사용자가 다른 언어를 요청하지 않는 한, 사용자에게 보이는 응답과 생성 또는 갱신하는 문서, 계획, 메모리 산출물은 OS locale 언어로 작성합니다.
100
- - 기본적으로 작업당 검증은 최대 두 번만 수행합니다.
101
- - 게이트가 실패하면 한 번 진단하고, 작업을 줄이거나 sub-task로 나눈 뒤 두 게이트를 다시 실행합니다.
102
- - 두 번 실패한 뒤에는 blocker를 `docs/plan/<topic>.md`에 기록합니다.
103
- EOF
104
- else
105
- cat > "$plan" <<'EOF'
106
- # PLAN
107
-
108
- This file is a short index of active and completed work plans.
109
-
110
- ## Active Plans
111
-
112
- - Link detailed plans under `docs/plan/`.
113
-
114
- ## Completed Plans
115
-
116
- - Move completed topics here with evidence links.
117
-
118
- ## Planning Rules
119
-
120
- - Read project-root `MEMORY.md` first when it exists; if it is absent, continue without repository memory.
121
- - For non-trivial implementation or continuation of planned work, first write or restore a plan with `triage-plan` active and synchronize it before exploration. Known-target Git/GitHub operations stay plan/goal-free unless they require code edits, conflict resolution, destructive recovery, release/deploy, or design.
122
- - Plans must be decision-complete before implementation.
123
- - Split implementation into small module tasks.
124
- - Detect repository stack and required LSP/check tools before implementation.
125
- - Install or bootstrap missing required tools before declaring them unavailable.
126
- - Each task normally passes exactly two gates.
127
- - Module acceptance verification.
128
- - Surface integration verification.
129
- - Run dry-run or check mode before external-state mutation when available.
130
- - Write user-visible responses and generated or updated documentation, plans, and memory artifacts in the OS locale unless the user asks for another language.
131
- - Use at most two verification passes per task by default.
132
- - If a gate fails, diagnose once, shrink the task or split it into sub-tasks, and rerun both gates.
133
- - After two failed passes, record the blocker in `docs/plan/<topic>.md`.
134
- EOF
135
- fi
136
- fi
137
-
138
- case "$event" in
139
- session-start|user-prompt-submit)
140
- if is_ko; then
141
- printf '%s\n' "Cairn 컨텍스트: 프로젝트 루트 MEMORY.md가 있으면 읽고, 없으면 저장소 메모리 없이 계속 진행합니다."
142
- else
143
- printf '%s\n' "Cairn context: read project-root MEMORY.md first when present; if absent, continue without repository memory."
144
- fi
145
- ;;
146
- post-tool-use)
147
- if is_ko; then
148
- printf '%s\n' "Cairn 점검: 외부 상태 변경에는 dry-run/check 증거가 필요하고, 동작이 바뀌었다면 docs/plan 증거를 갱신하세요."
149
- else
150
- printf '%s\n' "Cairn check: external-state changes need dry-run/check evidence; if behavior changed, update docs/plan evidence."
151
- fi
152
- ;;
153
- stop|subagent-stop)
154
- if is_ko; then
155
- printf '%s\n' "Cairn 종료 게이트: 완료에는 docs/plan의 dry-run/check, 모듈 수용, 표면 통합 증거가 필요합니다."
156
- else
157
- printf '%s\n' "Cairn stop gate: completion requires dry-run/check, module acceptance, and surface integration evidence in docs/plan."
158
- fi
159
- ;;
160
- *)
161
- if is_ko; then
162
- printf '%s\n' "Cairn이 MEMORY.md, PLAN.md, docs/memory, docs/plan을 초기화했습니다."
163
- else
164
- printf '%s\n' "Cairn initialized MEMORY.md, PLAN.md, docs/memory, and docs/plan."
165
- fi
166
- ;;
167
- esac