instar 1.3.325 → 1.3.327
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/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/postDriveTranscriptAudit.d.ts +8 -0
- package/dist/commands/postDriveTranscriptAudit.d.ts.map +1 -1
- package/dist/commands/postDriveTranscriptAudit.js +15 -1
- package/dist/commands/postDriveTranscriptAudit.js.map +1 -1
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +2 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/core/ForwardedTopicContext.d.ts.map +1 -1
- package/dist/core/ForwardedTopicContext.js +4 -6
- package/dist/core/ForwardedTopicContext.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +39 -6
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/lifeline/TelegramLifeline.d.ts.map +1 -1
- package/dist/lifeline/TelegramLifeline.js +2 -1
- package/dist/lifeline/TelegramLifeline.js.map +1 -1
- package/dist/memory/TopicMemory.d.ts.map +1 -1
- package/dist/memory/TopicMemory.js +3 -2
- package/dist/memory/TopicMemory.js.map +1 -1
- package/dist/messaging/shared/compactionResumePayload.d.ts.map +1 -1
- package/dist/messaging/shared/compactionResumePayload.js +2 -1
- package/dist/messaging/shared/compactionResumePayload.js.map +1 -1
- package/dist/monitoring/ApprenticeshipCycleStore.d.ts +45 -0
- package/dist/monitoring/ApprenticeshipCycleStore.d.ts.map +1 -1
- package/dist/monitoring/ApprenticeshipCycleStore.js +103 -5
- package/dist/monitoring/ApprenticeshipCycleStore.js.map +1 -1
- package/dist/monitoring/FrameworkIssueLedger.d.ts +4 -0
- package/dist/monitoring/FrameworkIssueLedger.d.ts.map +1 -1
- package/dist/monitoring/FrameworkIssueLedger.js +9 -0
- package/dist/monitoring/FrameworkIssueLedger.js.map +1 -1
- package/dist/scaffold/templates.js +1 -1
- package/dist/scheduler/MentorAutonomousGuardian.js +1 -1
- package/dist/scheduler/MentorAutonomousGuardian.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +22 -2
- package/dist/server/routes.js.map +1 -1
- package/dist/utils/localTime.d.ts +42 -0
- package/dist/utils/localTime.d.ts.map +1 -0
- package/dist/utils/localTime.js +60 -0
- package/dist/utils/localTime.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +99 -99
- package/src/scaffold/templates.ts +1 -1
- package/src/templates/hooks/compaction-recovery.sh +15 -3
- package/src/templates/hooks/slack-channel-context.sh +1 -1
- package/src/templates/hooks/telegram-topic-context.sh +8 -2
- package/upgrades/1.3.326.md +58 -0
- package/upgrades/1.3.327.md +57 -0
- package/upgrades/local-time-coherence.eli16.md +11 -0
- package/upgrades/side-effects/apprenticeship-transcript-audit-gate.md +53 -0
- package/upgrades/side-effects/local-time-coherence.md +89 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForwardedTopicContext.d.ts","sourceRoot":"","sources":["../../src/core/ForwardedTopicContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"ForwardedTopicContext.d.ts","sourceRoot":"","sources":["../../src/core/ForwardedTopicContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,kFAAkF;AAClF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,uBAAuB,EAAE,GAAG,IAAI,GAAG,SAAS,EACtD,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAmBR"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Pure + caller-agnostic so it is unit-testable without a live two-machine setup.
|
|
15
15
|
*/
|
|
16
|
+
import { formatLocalTimestamp } from '../utils/localTime.js';
|
|
16
17
|
/**
|
|
17
18
|
* Format fetched router-side history into a Thread History context block, or '' when
|
|
18
19
|
* there is nothing to inject. Mirrors the single-machine JSONL formatting in
|
|
@@ -30,12 +31,9 @@ export function formatForwardedTopicContext(messages, topicName) {
|
|
|
30
31
|
lines.push('');
|
|
31
32
|
for (const m of messages) {
|
|
32
33
|
const sender = m.fromUser ? (m.senderName || 'User') : 'Agent';
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (!Number.isNaN(d.getTime()))
|
|
37
|
-
ts = d.toISOString().slice(11, 19);
|
|
38
|
-
}
|
|
34
|
+
// Local time + tz label — unlabeled UTC here caused the 2026-06-05
|
|
35
|
+
// "9:23pm" incoherency (see src/utils/localTime.ts).
|
|
36
|
+
const ts = formatLocalTimestamp(m.timestamp);
|
|
39
37
|
const text = (m.text || '').slice(0, 2000);
|
|
40
38
|
lines.push(`[${ts}] ${sender}: ${text}`);
|
|
41
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ForwardedTopicContext.js","sourceRoot":"","sources":["../../src/core/ForwardedTopicContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"ForwardedTopicContext.js","sourceRoot":"","sources":["../../src/core/ForwardedTopicContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAU7D;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAAsD,EACtD,SAAkB;IAElB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACjE,MAAM,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OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,8BAA8B;IA6HtC,OAAO,CAAC,+BAA+B;IAuKvC,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,qBAAqB;IAqO7B,OAAO,CAAC,qBAAqB;IAwI7B,OAAO,CAAC,qBAAqB;IAyN7B,OAAO,CAAC,6BAA6B;IAkLrC,OAAO,CAAC,0BAA0B;IAgClC,OAAO,CAAC,gBAAgB;IAmJxB,OAAO,CAAC,6BAA6B;CAoCtC"}
|
|
@@ -2749,13 +2749,28 @@ The standing program that each apprenticeship/mentorship instance plugs into (e.
|
|
|
2749
2749
|
- List / inspect: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/apprenticeship/instances\` · \`GET /apprenticeship/instances/:id\`
|
|
2750
2750
|
- Create: \`POST /apprenticeship/instances\` \`{"id":"codey-to-gemini","instanceType":"mentorship","overseer":"echo","mentor":"codey","mentee":"gemini","framework":"gemini-cli","priorInstanceId":null}\` (id/overseer/mentor/mentee/framework charset-clamped to \`^[a-z0-9-]+$\`; dup id rejected; harvestFrom=mentor / harvestTo=mentee).
|
|
2751
2751
|
- Transition status (the ONLY way it changes — runs the gate): \`POST /apprenticeship/instances/:id/transition\` \`{"to":"active"}\` (refused + 409 on a failed gate or illegal transition; \`complete\` is terminal). Preview without mutating: \`.../can-start\` · \`.../can-complete\`.
|
|
2752
|
-
- Record a manual cycle: \`POST /apprenticeship/cycles\` with \`instanceId\`, positive \`cycleNumber\`, \`task\`, \`menteeOutput\`, optional \`mentorFlagged\` / \`overseerDifferential\` / \`coaching\` / \`infraItems\`, \`kind\` (\`mentor-mentee-differential\`, \`overseer-apprentice-devreview\`, \`overseer-mentee-direct\`), and \`channel\` (\`telegram-playwright\`, \`threadline-backup\`, \`direct-shortcut\`, \`unknown\`). Use this when the overseer or manual loop found a differential outside the automated mentor tick.
|
|
2752
|
+
- Record a manual cycle: \`POST /apprenticeship/cycles\` with \`instanceId\`, positive \`cycleNumber\`, \`task\`, \`menteeOutput\`, optional \`mentorFlagged\` / \`overseerDifferential\` / \`coaching\` / \`infraItems\`, \`kind\` (\`mentor-mentee-differential\`, \`overseer-apprentice-devreview\`, \`overseer-mentee-direct\`), and \`channel\` (\`telegram-playwright\`, \`threadline-backup\`, \`direct-shortcut\`, \`unknown\`). A \`telegram-playwright\` cycle additionally REQUIRES a \`transcriptAudit\` block — \`{ topicIds, window: {start,end}, summary, findingDedupKeys, generatedAt, ledger: 'local'|'remote'|'dry-run'|'failed' }\` — built from \`instar dev:post-drive-transcript-audit\` run over the drive window (use \`--history-base-url\` when the transcript lives on the mentee's server; \`ledger:'local'\` claims are cross-checked against the real framework ledger). Use this when the overseer or manual loop found a differential outside the automated mentor tick.
|
|
2753
2753
|
- **When to use** (PROACTIVE): when starting or closing a mentorship/apprenticeship instance, drive it through the registry + transitions so the retro-harvest is reviewed before the next instance starts and the lessons are captured before this one closes — never track the lifecycle by memory.
|
|
2754
2754
|
`;
|
|
2755
2755
|
content += '\n' + apprenticeshipSection;
|
|
2756
2756
|
patched = true;
|
|
2757
2757
|
result.upgraded.push('CLAUDE.md: added Apprenticeship Program section');
|
|
2758
2758
|
}
|
|
2759
|
+
// Transcript-audit gate (#864 follow-through): agents that ALREADY carry the
|
|
2760
|
+
// Apprenticeship Program section have the pre-gate "Record a manual cycle"
|
|
2761
|
+
// line, which no longer teaches the full required shape — telegram-playwright
|
|
2762
|
+
// cycles now refuse without a transcriptAudit block. Rewrite the stale line
|
|
2763
|
+
// in place. Idempotent: the sniff requires the old line present AND the new
|
|
2764
|
+
// marker absent, so it fires at most once per agent.
|
|
2765
|
+
{
|
|
2766
|
+
const staleCycleLine = /- Record a manual cycle: `POST \/apprenticeship\/cycles`[^\n]*mentor tick\./;
|
|
2767
|
+
const m = content.match(staleCycleLine);
|
|
2768
|
+
if (m && !m[0].includes('transcriptAudit')) {
|
|
2769
|
+
content = content.replace(staleCycleLine, "- Record a manual cycle: `POST /apprenticeship/cycles` with `instanceId`, positive `cycleNumber`, `task`, `menteeOutput`, optional `mentorFlagged` / `overseerDifferential` / `coaching` / `infraItems`, `kind` (`mentor-mentee-differential`, `overseer-apprentice-devreview`, `overseer-mentee-direct`), and `channel` (`telegram-playwright`, `threadline-backup`, `direct-shortcut`, `unknown`). A `telegram-playwright` cycle additionally REQUIRES a `transcriptAudit` block — `{ topicIds, window: {start,end}, summary, findingDedupKeys, generatedAt, ledger: 'local'|'remote'|'dry-run'|'failed' }` — built from `instar dev:post-drive-transcript-audit` run over the drive window (use `--history-base-url` when the transcript lives on the mentee's server; `ledger:'local'` claims are cross-checked against the real framework ledger). Use this when the overseer or manual loop found a differential outside the automated mentor tick.");
|
|
2770
|
+
patched = true;
|
|
2771
|
+
result.upgraded.push('CLAUDE.md: cycle-record line now teaches the transcript-audit gate');
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2759
2774
|
// Maturity honesty (mature-update-announcements spec). Existing agents need
|
|
2760
2775
|
// to know user-facing update announcements are now opt-in + maturity-tagged
|
|
2761
2776
|
// so they mirror that honesty when self-narrating a ship (and don't dress up
|
|
@@ -5865,10 +5880,16 @@ if [ -n "\$INSTAR_TELEGRAM_TOPIC" ]; then
|
|
|
5865
5880
|
echo "RECENT MESSAGES:"
|
|
5866
5881
|
echo "\$TOPIC_CTX" | python3 -c "
|
|
5867
5882
|
import sys, json
|
|
5883
|
+
def _localts(raw):
|
|
5884
|
+
try:
|
|
5885
|
+
from datetime import datetime
|
|
5886
|
+
return datetime.fromisoformat(str(raw).replace('Z', '+00:00')).astimezone().strftime('%Y-%m-%d %H:%M %Z')
|
|
5887
|
+
except Exception:
|
|
5888
|
+
return str(raw)[:16].replace('T', ' ')
|
|
5868
5889
|
d = json.load(sys.stdin)
|
|
5869
5890
|
for m in d.get('recentMessages', []):
|
|
5870
5891
|
sender = 'User' if m.get('fromUser') else 'Agent'
|
|
5871
|
-
ts = m.get('timestamp', '')
|
|
5892
|
+
ts = _localts(m.get('timestamp', ''))
|
|
5872
5893
|
text = m.get('text', '')
|
|
5873
5894
|
if len(text) > 500:
|
|
5874
5895
|
text = text[:500] + '...'
|
|
@@ -6738,6 +6759,12 @@ fi
|
|
|
6738
6759
|
# Format and output context with unanswered message detection
|
|
6739
6760
|
echo "\$RECENT_MSGS" | python3 -c "
|
|
6740
6761
|
import sys, json
|
|
6762
|
+
def _localts(raw):
|
|
6763
|
+
try:
|
|
6764
|
+
from datetime import datetime
|
|
6765
|
+
return datetime.fromisoformat(str(raw).replace('Z', '+00:00')).astimezone().strftime('%Y-%m-%d %H:%M %Z')
|
|
6766
|
+
except Exception:
|
|
6767
|
+
return str(raw)[:16].replace('T', ' ')
|
|
6741
6768
|
try:
|
|
6742
6769
|
data = json.load(sys.stdin)
|
|
6743
6770
|
msgs = data.get('messages', [])
|
|
@@ -6747,7 +6774,7 @@ try:
|
|
|
6747
6774
|
print('TOPIC \${TOPIC_ID} RECENT HISTORY (auto-injected):')
|
|
6748
6775
|
|
|
6749
6776
|
for m in msgs:
|
|
6750
|
-
ts = m.get('timestamp', '')
|
|
6777
|
+
ts = _localts(m.get('timestamp', ''))
|
|
6751
6778
|
from_user = m.get('fromUser', m.get('direction', 'in') == 'in')
|
|
6752
6779
|
text = m.get('text', '').strip()
|
|
6753
6780
|
sender = 'User' if from_user else 'Agent'
|
|
@@ -6772,7 +6799,7 @@ try:
|
|
|
6772
6799
|
print('*** UNANSWERED MESSAGE(S) FROM USER ***')
|
|
6773
6800
|
for pm in pending_user:
|
|
6774
6801
|
pm_text = pm.get('text', '')[:200]
|
|
6775
|
-
pm_ts = pm.get('timestamp', '')
|
|
6802
|
+
pm_ts = _localts(pm.get('timestamp', ''))
|
|
6776
6803
|
print(f' [{pm_ts}] \\\\\\\"{pm_text}\\\\\\\"')
|
|
6777
6804
|
print()
|
|
6778
6805
|
print('You MUST address these messages substantively. Do NOT respond with just')
|
|
@@ -6834,11 +6861,17 @@ if [ -n "\$INSTAR_TELEGRAM_TOPIC" ]; then
|
|
|
6834
6861
|
echo "RECENT MESSAGES:"
|
|
6835
6862
|
echo "\$TOPIC_CTX" | python3 -c "
|
|
6836
6863
|
import sys, json
|
|
6864
|
+
def _localts(raw):
|
|
6865
|
+
try:
|
|
6866
|
+
from datetime import datetime
|
|
6867
|
+
return datetime.fromisoformat(str(raw).replace('Z', '+00:00')).astimezone().strftime('%Y-%m-%d %H:%M %Z')
|
|
6868
|
+
except Exception:
|
|
6869
|
+
return str(raw)[:16].replace('T', ' ')
|
|
6837
6870
|
d = json.load(sys.stdin)
|
|
6838
6871
|
msgs = d.get('recentMessages', [])
|
|
6839
6872
|
for m in msgs:
|
|
6840
6873
|
sender = 'User' if m.get('fromUser') else 'Agent'
|
|
6841
|
-
ts = m.get('timestamp', '')
|
|
6874
|
+
ts = _localts(m.get('timestamp', ''))
|
|
6842
6875
|
text = m.get('text', '')
|
|
6843
6876
|
if len(text) > 500:
|
|
6844
6877
|
text = text[:500] + '...'
|
|
@@ -6861,7 +6894,7 @@ if pending_user:
|
|
|
6861
6894
|
print('UNANSWERED MESSAGE(S) FROM USER:')
|
|
6862
6895
|
for pm in pending_user:
|
|
6863
6896
|
pm_text = pm.get('text', '')[:200]
|
|
6864
|
-
pm_ts = pm.get('timestamp', '')
|
|
6897
|
+
pm_ts = _localts(pm.get('timestamp', ''))
|
|
6865
6898
|
print(f' [{pm_ts}] \\\"{pm_text}\\\"')
|
|
6866
6899
|
print()
|
|
6867
6900
|
print('You MUST address these messages substantively. Do NOT respond')
|