open-research-protocol 0.3.0
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/AGENT_INTEGRATION.md +94 -0
- package/INSTALL.md +159 -0
- package/LICENSE +22 -0
- package/PROTOCOL.md +140 -0
- package/README.md +312 -0
- package/bin/orp.js +38 -0
- package/cli/orp.py +3595 -0
- package/cone/CONTEXT_LOG.md +33 -0
- package/docs/AGENT_LOOP.md +63 -0
- package/docs/CHOOSING_OR_IGNORING_INSTRUMENTS.md +128 -0
- package/docs/CODA_ORP_CONTRACT.md +222 -0
- package/docs/CORE_ABILITY_REFOCUS_CHECKLIST.md +62 -0
- package/docs/DISCOVER.md +69 -0
- package/docs/EXTERNAL_CONTRIBUTION_GOVERNANCE.md +275 -0
- package/docs/MATHLIB_COLLABORATION_FLOW_PROMPT.md +112 -0
- package/docs/NPM_RELEASE_CHECKLIST.md +55 -0
- package/docs/ORP_V1_ATOMIC_DISCOVERY_EVOLUTION.md +186 -0
- package/docs/OSS_CONTRIBUTION_AGENT_LOOP.md +69 -0
- package/docs/PRESENTATION_BOW.md +100 -0
- package/docs/PROFILE_PACKS.md +227 -0
- package/docs/SUNFLOWER_CODA_PR_GOVERNANCE_MAPPING.md +77 -0
- package/docs/WHY_INSTRUMENTS.md +118 -0
- package/examples/README.md +21 -0
- package/examples/example_claim.md +33 -0
- package/examples/example_failed.md +24 -0
- package/examples/example_verification.md +36 -0
- package/examples/orp.erdos-problems.catalog.yml +88 -0
- package/examples/orp.external-pr-governance.yml +223 -0
- package/examples/orp.sunflower-coda.atomic.yml +144 -0
- package/examples/orp.sunflower-coda.live-compare.yml +181 -0
- package/examples/orp.sunflower-coda.pr-governance.yml +253 -0
- package/examples/packet.problem_scope.example.json +123 -0
- package/examples/reports/README.md +16 -0
- package/examples/reports/sunflower_live_compare_20.RUN_SUMMARY.md +37 -0
- package/examples/reports/sunflower_live_compare_367.RUN_SUMMARY.md +37 -0
- package/examples/reports/sunflower_live_compare_857.RUN_SUMMARY.md +37 -0
- package/llms.txt +58 -0
- package/modules/instruments/ADVERSARIAL/README.md +109 -0
- package/modules/instruments/ADVERSARIAL/TEMPLATE.md +27 -0
- package/modules/instruments/COMPRESSION/README.md +112 -0
- package/modules/instruments/COMPRESSION/TEMPLATE.md +27 -0
- package/modules/instruments/INSTRUMENT_TEMPLATE.md +30 -0
- package/modules/instruments/ORBIT/README.md +124 -0
- package/modules/instruments/ORBIT/TEMPLATE.md +28 -0
- package/modules/instruments/README.md +179 -0
- package/package.json +54 -0
- package/packs/README.md +16 -0
- package/packs/erdos-open-problems/README.md +287 -0
- package/packs/erdos-open-problems/data/README.md +43 -0
- package/packs/erdos-open-problems/data/erdos_open_problems.md +697 -0
- package/packs/erdos-open-problems/data/erdos_problems.active.json +15561 -0
- package/packs/erdos-open-problems/data/erdos_problems.all.json +26289 -0
- package/packs/erdos-open-problems/data/erdos_problems.closed.json +10760 -0
- package/packs/erdos-open-problems/data/erdos_problems.open.json +15561 -0
- package/packs/erdos-open-problems/docs/SUNFLOWER_ADAPTER_DEPENDENCIES.md +63 -0
- package/packs/erdos-open-problems/pack.yml +131 -0
- package/packs/erdos-open-problems/profiles/erdos-problems-catalog-sync.yml.tmpl +99 -0
- package/packs/erdos-open-problems/profiles/sunflower-live-compare.yml.tmpl +188 -0
- package/packs/erdos-open-problems/profiles/sunflower-mathlib-pr-governance.yml.tmpl +253 -0
- package/packs/erdos-open-problems/profiles/sunflower-problem857-discovery-public-repo.yml.tmpl +152 -0
- package/packs/erdos-open-problems/profiles/sunflower-problem857-discovery.yml.tmpl +154 -0
- package/packs/external-pr-governance/README.md +116 -0
- package/packs/external-pr-governance/adapters/formal-conjectures/README.md +35 -0
- package/packs/external-pr-governance/adapters/mathlib/README.md +37 -0
- package/packs/external-pr-governance/pack.yml +146 -0
- package/packs/external-pr-governance/profiles/oss-feedback-hardening.yml.tmpl +92 -0
- package/packs/external-pr-governance/profiles/oss-pr-governance.yml.tmpl +233 -0
- package/packs/issue-smashers/README.md +92 -0
- package/packs/issue-smashers/adapters/formal-conjectures/README.md +17 -0
- package/packs/issue-smashers/adapters/generic-github/README.md +16 -0
- package/packs/issue-smashers/adapters/mathlib/README.md +32 -0
- package/packs/issue-smashers/bootstrap/README.md +19 -0
- package/packs/issue-smashers/bootstrap/setup-issue-smashers.sh +18 -0
- package/packs/issue-smashers/examples/issue-smashers.workspace.yml +24 -0
- package/packs/issue-smashers/pack.yml +178 -0
- package/packs/issue-smashers/profiles/issue-smashers-feedback-hardening.yml.tmpl +102 -0
- package/packs/issue-smashers/profiles/issue-smashers.yml.tmpl +258 -0
- package/scripts/npm-postinstall-check.js +31 -0
- package/scripts/orp +11 -0
- package/scripts/orp-agent-integrate.sh +197 -0
- package/scripts/orp-checkpoint.sh +184 -0
- package/scripts/orp-erdos-problems-sync.py +580 -0
- package/scripts/orp-init.sh +50 -0
- package/scripts/orp-pack-fetch.py +155 -0
- package/scripts/orp-pack-install.py +2273 -0
- package/scripts/orp-pack-render.py +188 -0
- package/spec/v1/LIFECYCLE_MAPPING.md +40 -0
- package/spec/v1/orp.config.schema.json +385 -0
- package/spec/v1/packet.schema.json +552 -0
- package/spec/v1/profile-pack.schema.json +95 -0
- package/templates/CLAIM.md +33 -0
- package/templates/FAILED_TOPIC.md +19 -0
- package/templates/ISSUE_TEMPLATE.md +22 -0
- package/templates/VERIFICATION_RECORD.md +34 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
# orp-agent-integrate.sh — install/check/sync the ORP agent instructions snippet in a target Markdown file.
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# ./scripts/orp-agent-integrate.sh [--check|--sync] /path/to/your/agent/instructions.md
|
|
8
|
+
|
|
9
|
+
usage() {
|
|
10
|
+
cat <<EOF
|
|
11
|
+
usage:
|
|
12
|
+
$0 /path/to/agent/instructions.md
|
|
13
|
+
$0 --check /path/to/agent/instructions.md
|
|
14
|
+
$0 --sync /path/to/agent/instructions.md
|
|
15
|
+
|
|
16
|
+
default behavior:
|
|
17
|
+
Append the ORP snippet if missing (never overwrites).
|
|
18
|
+
|
|
19
|
+
--check:
|
|
20
|
+
Exit 0 if the ORP snippet exists and matches the canonical snippet in AGENT_INTEGRATION.md.
|
|
21
|
+
Exit 1 if missing or out of date.
|
|
22
|
+
|
|
23
|
+
--sync:
|
|
24
|
+
Ensure the target contains the canonical ORP snippet (append if missing; replace if present but out of date).
|
|
25
|
+
EOF
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
MODE="append"
|
|
29
|
+
while [ $# -gt 0 ]; do
|
|
30
|
+
case "$1" in
|
|
31
|
+
--check) MODE="check"; shift ;;
|
|
32
|
+
--sync) MODE="sync"; shift ;;
|
|
33
|
+
--help|-h) usage; exit 0 ;;
|
|
34
|
+
--) shift; break ;;
|
|
35
|
+
-*) usage; exit 2 ;;
|
|
36
|
+
*) break ;;
|
|
37
|
+
esac
|
|
38
|
+
done
|
|
39
|
+
|
|
40
|
+
if [ "${1:-}" = "" ]; then
|
|
41
|
+
usage
|
|
42
|
+
exit 2
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
TARGET="$1"
|
|
46
|
+
MARKER_BEGIN="<!-- ORP:BEGIN -->"
|
|
47
|
+
MARKER_END="<!-- ORP:END -->"
|
|
48
|
+
|
|
49
|
+
SNIPPET_TMP=""
|
|
50
|
+
TARGET_SNIPPET_TMP=""
|
|
51
|
+
OUT_TMP=""
|
|
52
|
+
cleanup() {
|
|
53
|
+
if [ -n "${SNIPPET_TMP:-}" ] && [ -f "$SNIPPET_TMP" ]; then
|
|
54
|
+
rm -f "$SNIPPET_TMP"
|
|
55
|
+
fi
|
|
56
|
+
if [ -n "${TARGET_SNIPPET_TMP:-}" ] && [ -f "$TARGET_SNIPPET_TMP" ]; then
|
|
57
|
+
rm -f "$TARGET_SNIPPET_TMP"
|
|
58
|
+
fi
|
|
59
|
+
if [ -n "${OUT_TMP:-}" ] && [ -f "$OUT_TMP" ]; then
|
|
60
|
+
rm -f "$OUT_TMP"
|
|
61
|
+
fi
|
|
62
|
+
:
|
|
63
|
+
}
|
|
64
|
+
trap cleanup EXIT
|
|
65
|
+
|
|
66
|
+
SCRIPT_PATH="$0"
|
|
67
|
+
case "$SCRIPT_PATH" in
|
|
68
|
+
*/*) : ;;
|
|
69
|
+
*) SCRIPT_PATH="$(command -v "$SCRIPT_PATH" 2>/dev/null || printf '%s' "$SCRIPT_PATH")" ;;
|
|
70
|
+
esac
|
|
71
|
+
|
|
72
|
+
ROOT_DIR="$(cd "$(dirname "$SCRIPT_PATH")/.." && pwd)"
|
|
73
|
+
SNIPPET_FILE="$ROOT_DIR/AGENT_INTEGRATION.md"
|
|
74
|
+
|
|
75
|
+
if [ ! -f "$SNIPPET_FILE" ]; then
|
|
76
|
+
echo "error: missing $SNIPPET_FILE"
|
|
77
|
+
exit 4
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
SNIPPET_TMP="$(mktemp)"
|
|
81
|
+
awk '
|
|
82
|
+
$0=="<!-- ORP:BEGIN -->" {p=1}
|
|
83
|
+
p {print}
|
|
84
|
+
$0=="<!-- ORP:END -->" {exit}
|
|
85
|
+
' "$SNIPPET_FILE" > "$SNIPPET_TMP"
|
|
86
|
+
|
|
87
|
+
if ! grep -q "$MARKER_BEGIN" "$SNIPPET_TMP" || ! grep -q "$MARKER_END" "$SNIPPET_TMP"; then
|
|
88
|
+
echo "error: ORP snippet markers not found in $SNIPPET_FILE"
|
|
89
|
+
exit 4
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
cksum2() {
|
|
93
|
+
cksum "$1" | awk '{print $1 " " $2}'
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
canonical_sig="$(cksum2 "$SNIPPET_TMP")"
|
|
97
|
+
|
|
98
|
+
has_begin="0"
|
|
99
|
+
has_end="0"
|
|
100
|
+
if [ -f "$TARGET" ]; then
|
|
101
|
+
if grep -q "$MARKER_BEGIN" "$TARGET"; then has_begin="1"; fi
|
|
102
|
+
if grep -q "$MARKER_END" "$TARGET"; then has_end="1"; fi
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
if [ "$has_begin" = "1" ] && [ "$has_end" = "0" ]; then
|
|
106
|
+
echo "error: $TARGET contains $MARKER_BEGIN but not $MARKER_END"
|
|
107
|
+
exit 4
|
|
108
|
+
fi
|
|
109
|
+
if [ "$has_begin" = "0" ] && [ "$has_end" = "1" ]; then
|
|
110
|
+
echo "error: $TARGET contains $MARKER_END but not $MARKER_BEGIN"
|
|
111
|
+
exit 4
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
target_sig=""
|
|
115
|
+
if [ "$has_begin" = "1" ]; then
|
|
116
|
+
TARGET_SNIPPET_TMP="$(mktemp)"
|
|
117
|
+
awk '
|
|
118
|
+
$0=="<!-- ORP:BEGIN -->" {p=1}
|
|
119
|
+
p {print}
|
|
120
|
+
$0=="<!-- ORP:END -->" {exit}
|
|
121
|
+
' "$TARGET" > "$TARGET_SNIPPET_TMP"
|
|
122
|
+
target_sig="$(cksum2 "$TARGET_SNIPPET_TMP")"
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
if [ "$MODE" = "check" ]; then
|
|
126
|
+
if [ "$has_begin" = "0" ]; then
|
|
127
|
+
echo "ORP snippet missing in: $TARGET"
|
|
128
|
+
echo "Fix: $0 --sync $TARGET"
|
|
129
|
+
exit 1
|
|
130
|
+
fi
|
|
131
|
+
if [ "$target_sig" = "$canonical_sig" ]; then
|
|
132
|
+
echo "OK: ORP snippet is up to date in: $TARGET"
|
|
133
|
+
exit 0
|
|
134
|
+
fi
|
|
135
|
+
echo "OUT OF DATE: ORP snippet differs from $SNIPPET_FILE"
|
|
136
|
+
echo "Fix: $0 --sync $TARGET"
|
|
137
|
+
exit 1
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
if [ "$MODE" = "append" ] && [ "$has_begin" = "1" ]; then
|
|
141
|
+
echo "ORP snippet already present in: $TARGET (not modifying)"
|
|
142
|
+
echo "Tip: $0 --check $TARGET (detect drift)"
|
|
143
|
+
echo "Tip: $0 --sync $TARGET (update in place)"
|
|
144
|
+
exit 0
|
|
145
|
+
fi
|
|
146
|
+
|
|
147
|
+
mkdir -p "$(dirname "$TARGET")"
|
|
148
|
+
|
|
149
|
+
if [ "$MODE" = "append" ]; then
|
|
150
|
+
if [ -f "$TARGET" ] && [ -s "$TARGET" ]; then
|
|
151
|
+
printf '\n' >> "$TARGET"
|
|
152
|
+
fi
|
|
153
|
+
cat "$SNIPPET_TMP" >> "$TARGET"
|
|
154
|
+
echo "ORP snippet appended to: $TARGET"
|
|
155
|
+
echo "Next: ensure your agent uses that file as its primary instructions."
|
|
156
|
+
exit 0
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
if [ "$MODE" = "sync" ]; then
|
|
160
|
+
if [ "$has_begin" = "0" ]; then
|
|
161
|
+
if [ -f "$TARGET" ] && [ -s "$TARGET" ]; then
|
|
162
|
+
printf '\n' >> "$TARGET"
|
|
163
|
+
fi
|
|
164
|
+
cat "$SNIPPET_TMP" >> "$TARGET"
|
|
165
|
+
echo "ORP snippet appended to: $TARGET"
|
|
166
|
+
echo "Next: ensure your agent uses that file as its primary instructions."
|
|
167
|
+
exit 0
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
OUT_TMP="$(mktemp)"
|
|
171
|
+
awk -v begin="$MARKER_BEGIN" -v end="$MARKER_END" -v snippet="$SNIPPET_TMP" '
|
|
172
|
+
BEGIN {in_old=0}
|
|
173
|
+
{
|
|
174
|
+
if ($0==begin) {
|
|
175
|
+
in_old=1
|
|
176
|
+
while ((getline line < snippet) > 0) print line
|
|
177
|
+
close(snippet)
|
|
178
|
+
next
|
|
179
|
+
}
|
|
180
|
+
if (in_old) {
|
|
181
|
+
if ($0==end) in_old=0
|
|
182
|
+
next
|
|
183
|
+
}
|
|
184
|
+
print
|
|
185
|
+
}
|
|
186
|
+
' "$TARGET" > "$OUT_TMP"
|
|
187
|
+
|
|
188
|
+
mv "$OUT_TMP" "$TARGET"
|
|
189
|
+
OUT_TMP=""
|
|
190
|
+
|
|
191
|
+
echo "ORP snippet synced in: $TARGET"
|
|
192
|
+
echo "Next: ensure your agent uses that file as its primary instructions."
|
|
193
|
+
exit 0
|
|
194
|
+
fi
|
|
195
|
+
|
|
196
|
+
echo "error: unknown mode"
|
|
197
|
+
exit 4
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
# orp-checkpoint.sh — lightweight ORP checkpoint for agentic workflows (process-only).
|
|
5
|
+
#
|
|
6
|
+
# Typical usage (agent knows its instruction file path):
|
|
7
|
+
# ./scripts/orp-checkpoint.sh --agent-file /path/to/agent/instructions.md "pre-push checkpoint"
|
|
8
|
+
#
|
|
9
|
+
# Modes:
|
|
10
|
+
# --status : print last checkpoint + current git status summary (no write)
|
|
11
|
+
# --check : run checks only (no write)
|
|
12
|
+
# --sync : sync ORP snippet into agent files before checking (requires --agent-file)
|
|
13
|
+
#
|
|
14
|
+
# Exit codes:
|
|
15
|
+
# 0 = OK
|
|
16
|
+
# 1 = ORP snippet missing/out of date in one or more agent files (or check failed)
|
|
17
|
+
# 2 = usage error
|
|
18
|
+
# 4 = internal/config error
|
|
19
|
+
|
|
20
|
+
usage() {
|
|
21
|
+
cat <<EOF
|
|
22
|
+
usage:
|
|
23
|
+
$0 [--status|--check] [--sync] [--agent-file PATH ...] [--log-file PATH] [NOTE]
|
|
24
|
+
|
|
25
|
+
examples:
|
|
26
|
+
$0 --status
|
|
27
|
+
$0 --agent-file CLAUDE.md "compaction checkpoint"
|
|
28
|
+
$0 --sync --agent-file CLAUDE.md --agent-file AGENTS.md "pre-push checkpoint"
|
|
29
|
+
$0 --check --agent-file CLAUDE.md
|
|
30
|
+
EOF
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
MODE="write"
|
|
34
|
+
DO_SYNC="0"
|
|
35
|
+
LOG_FILE=""
|
|
36
|
+
NOTE=""
|
|
37
|
+
AGENT_FILES=""
|
|
38
|
+
|
|
39
|
+
while [ $# -gt 0 ]; do
|
|
40
|
+
case "$1" in
|
|
41
|
+
--status) MODE="status"; shift ;;
|
|
42
|
+
--check) MODE="check"; shift ;;
|
|
43
|
+
--sync) DO_SYNC="1"; shift ;;
|
|
44
|
+
--agent-file)
|
|
45
|
+
shift
|
|
46
|
+
if [ "${1:-}" = "" ]; then usage; exit 2; fi
|
|
47
|
+
AGENT_FILES="${AGENT_FILES}${AGENT_FILES:+
|
|
48
|
+
}$1"
|
|
49
|
+
shift
|
|
50
|
+
;;
|
|
51
|
+
--log-file)
|
|
52
|
+
shift
|
|
53
|
+
if [ "${1:-}" = "" ]; then usage; exit 2; fi
|
|
54
|
+
LOG_FILE="$1"
|
|
55
|
+
shift
|
|
56
|
+
;;
|
|
57
|
+
--help|-h) usage; exit 0 ;;
|
|
58
|
+
--) shift; break ;;
|
|
59
|
+
-*) usage; exit 2 ;;
|
|
60
|
+
*) NOTE="${NOTE}${NOTE:+ }$1"; shift ;;
|
|
61
|
+
esac
|
|
62
|
+
done
|
|
63
|
+
|
|
64
|
+
SCRIPT_PATH="$0"
|
|
65
|
+
case "$SCRIPT_PATH" in
|
|
66
|
+
*/*) : ;;
|
|
67
|
+
*) SCRIPT_PATH="$(command -v "$SCRIPT_PATH" 2>/dev/null || printf '%s' "$SCRIPT_PATH")" ;;
|
|
68
|
+
esac
|
|
69
|
+
|
|
70
|
+
ORP_ROOT="$(cd "$(dirname "$SCRIPT_PATH")/.." && pwd)"
|
|
71
|
+
cd "$ORP_ROOT"
|
|
72
|
+
|
|
73
|
+
if [ "$LOG_FILE" = "" ]; then
|
|
74
|
+
LOG_FILE="$ORP_ROOT/cone/CONTEXT_LOG.md"
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
timestamp_utc="$(date -u "+%Y-%m-%dT%H:%M:%SZ")"
|
|
78
|
+
|
|
79
|
+
git_inside="0"
|
|
80
|
+
git_root=""
|
|
81
|
+
git_branch=""
|
|
82
|
+
git_head=""
|
|
83
|
+
staged_count="0"
|
|
84
|
+
unstaged_count="0"
|
|
85
|
+
untracked_count="0"
|
|
86
|
+
|
|
87
|
+
if git_root="$(git rev-parse --show-toplevel 2>/dev/null)"; then
|
|
88
|
+
git_inside="1"
|
|
89
|
+
git_branch="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || true)"
|
|
90
|
+
git_head="$(git rev-parse --short HEAD 2>/dev/null || true)"
|
|
91
|
+
status="$(git status --porcelain=v1 2>/dev/null || true)"
|
|
92
|
+
if [ "$status" != "" ]; then
|
|
93
|
+
staged_count="$(printf '%s\n' "$status" | awk 'substr($0,1,2)!="??" && substr($0,1,1)!=" " {c++} END{print c+0}')"
|
|
94
|
+
unstaged_count="$(printf '%s\n' "$status" | awk 'substr($0,1,2)!="??" && substr($0,2,1)!=" " {c++} END{print c+0}')"
|
|
95
|
+
untracked_count="$(printf '%s\n' "$status" | awk 'substr($0,1,2)=="??" {c++} END{print c+0}')"
|
|
96
|
+
fi
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
last_checkpoint="(none)"
|
|
100
|
+
if [ -f "$LOG_FILE" ]; then
|
|
101
|
+
last_line="$(awk '/^## Checkpoint — /{x=$0} END{print x}' "$LOG_FILE")"
|
|
102
|
+
if [ "${last_line:-}" != "" ]; then
|
|
103
|
+
last_checkpoint="${last_line#\#\# Checkpoint — }"
|
|
104
|
+
fi
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
echo "ORP root: $ORP_ROOT"
|
|
108
|
+
echo "Checkpoint log: $LOG_FILE"
|
|
109
|
+
echo "Last checkpoint: $last_checkpoint"
|
|
110
|
+
if [ "$git_inside" = "1" ]; then
|
|
111
|
+
echo "Git: branch=$git_branch head=$git_head staged=$staged_count unstaged=$unstaged_count untracked=$untracked_count"
|
|
112
|
+
else
|
|
113
|
+
echo "Git: (not a git repo)"
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
orp_check_status="skipped"
|
|
117
|
+
orp_check_exit="0"
|
|
118
|
+
agent_checked=""
|
|
119
|
+
|
|
120
|
+
if [ "$AGENT_FILES" != "" ]; then
|
|
121
|
+
orp_check_status="PASS"
|
|
122
|
+
agent_checked="$(printf '%s' "$AGENT_FILES" | tr '\n' ' ')"
|
|
123
|
+
while IFS= read -r f; do
|
|
124
|
+
[ "$f" = "" ] && continue
|
|
125
|
+
if [ "$DO_SYNC" = "1" ]; then
|
|
126
|
+
"$ORP_ROOT/scripts/orp-agent-integrate.sh" --sync "$f" >/dev/null
|
|
127
|
+
fi
|
|
128
|
+
if "$ORP_ROOT/scripts/orp-agent-integrate.sh" --check "$f" >/dev/null; then
|
|
129
|
+
:
|
|
130
|
+
else
|
|
131
|
+
orp_check_status="FAIL"
|
|
132
|
+
orp_check_exit="1"
|
|
133
|
+
fi
|
|
134
|
+
done <<EOF
|
|
135
|
+
$AGENT_FILES
|
|
136
|
+
EOF
|
|
137
|
+
fi
|
|
138
|
+
|
|
139
|
+
echo "ORP snippet sync: $orp_check_status"
|
|
140
|
+
|
|
141
|
+
if [ "$MODE" = "status" ]; then
|
|
142
|
+
exit 0
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
if [ "$MODE" = "check" ]; then
|
|
146
|
+
exit "$orp_check_exit"
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
150
|
+
if [ ! -f "$LOG_FILE" ]; then
|
|
151
|
+
cat >"$LOG_FILE" <<'EOF'
|
|
152
|
+
# Context Log (process-only; not evidence)
|
|
153
|
+
|
|
154
|
+
> This file is **not evidence**. It is a running, lightweight trace of “what’s going on” to support handoff, compaction, and
|
|
155
|
+
> coordination.
|
|
156
|
+
EOF
|
|
157
|
+
printf '\n' >> "$LOG_FILE"
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
{
|
|
161
|
+
echo
|
|
162
|
+
echo "## Checkpoint — $timestamp_utc"
|
|
163
|
+
echo "- Note: ${NOTE:-}"
|
|
164
|
+
echo "- Repo state:"
|
|
165
|
+
if [ "$git_inside" = "1" ]; then
|
|
166
|
+
echo " - Branch: $git_branch"
|
|
167
|
+
echo " - Head: $git_head"
|
|
168
|
+
echo " - Git status: staged=$staged_count, unstaged=$unstaged_count, untracked=$untracked_count"
|
|
169
|
+
else
|
|
170
|
+
echo " - Branch:"
|
|
171
|
+
echo " - Head:"
|
|
172
|
+
echo " - Git status: staged=?, unstaged=?, untracked=?"
|
|
173
|
+
fi
|
|
174
|
+
echo "- ORP snippet sync:"
|
|
175
|
+
echo " - Agent instruction files checked: ${agent_checked:-}"
|
|
176
|
+
echo " - Result: $orp_check_status"
|
|
177
|
+
echo "- Canonical artifacts touched (paths only):"
|
|
178
|
+
echo "- Next hook:"
|
|
179
|
+
} >> "$LOG_FILE"
|
|
180
|
+
|
|
181
|
+
echo "Wrote checkpoint entry."
|
|
182
|
+
|
|
183
|
+
exit "$orp_check_exit"
|
|
184
|
+
|