instar 1.3.0 → 1.3.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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +41 -3
- package/dist/commands/server.js.map +1 -1
- package/dist/core/CodexCliIntelligenceProvider.d.ts +5 -4
- package/dist/core/CodexCliIntelligenceProvider.d.ts.map +1 -1
- package/dist/core/CodexCliIntelligenceProvider.js +55 -3
- package/dist/core/CodexCliIntelligenceProvider.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +11 -9
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +1 -8
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +18 -65
- package/dist/server/routes.js.map +1 -1
- package/dist/threadline/CollaborationSurfacer.d.ts.map +1 -1
- package/dist/threadline/CollaborationSurfacer.js +7 -3
- package/dist/threadline/CollaborationSurfacer.js.map +1 -1
- package/dist/threadline/hubCommands.d.ts +67 -0
- package/dist/threadline/hubCommands.d.ts.map +1 -0
- package/dist/threadline/hubCommands.js +126 -0
- package/dist/threadline/hubCommands.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +62 -62
- package/src/scaffold/templates.ts +1 -8
- package/upgrades/1.3.1.md +27 -0
- package/upgrades/1.3.2.md +49 -0
- package/upgrades/side-effects/fix-codex-intel-clean-call.md +108 -0
- package/upgrades/side-effects/threadline-open-this-deterministic.md +45 -0
|
@@ -22,16 +22,17 @@ export interface CodexCliIntelligenceProviderOptions {
|
|
|
22
22
|
*/
|
|
23
23
|
sandboxMode?: 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* Retained for API compatibility. NOTE: this is intentionally NOT used as
|
|
26
|
+
* the `codex exec --cd` for judgment calls. Those always run in an empty
|
|
27
|
+
* instar-managed scratch dir (see `resolveIntelligenceScratchDir`) so the
|
|
28
|
+
* agent's project identity + hooks never load. These calls don't depend on
|
|
29
|
+
* cwd content, so ignoring this value is safe.
|
|
28
30
|
*/
|
|
29
31
|
workingDirectory?: string;
|
|
30
32
|
}
|
|
31
33
|
export declare class CodexCliIntelligenceProvider implements IntelligenceProvider {
|
|
32
34
|
private readonly codexPath;
|
|
33
35
|
private readonly sandboxMode;
|
|
34
|
-
private readonly workingDirectory;
|
|
35
36
|
constructor(options: CodexCliIntelligenceProviderOptions);
|
|
36
37
|
evaluate(prompt: string, options?: IntelligenceOptions): Promise<string>;
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodexCliIntelligenceProvider.d.ts","sourceRoot":"","sources":["../../src/core/CodexCliIntelligenceProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"CodexCliIntelligenceProvider.d.ts","sourceRoot":"","sources":["../../src/core/CodexCliIntelligenceProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA6C5E,MAAM,WAAW,mCAAmC;IAClD,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;IACrE;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,4BAA6B,YAAW,oBAAoB;IACvE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyD;gBAEzE,OAAO,EAAE,mCAAmC;IASlD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CA6E/E"}
|
|
@@ -12,26 +12,78 @@
|
|
|
12
12
|
* implementation based on the agent's configured framework.
|
|
13
13
|
*/
|
|
14
14
|
import { execFile } from 'node:child_process';
|
|
15
|
+
import { mkdtempSync, existsSync } from 'node:fs';
|
|
16
|
+
import { tmpdir } from 'node:os';
|
|
17
|
+
import { join } from 'node:path';
|
|
15
18
|
import { resolveCliModelFlag } from '../providers/adapters/openai-codex/models.js';
|
|
16
19
|
import { buildCodexChildEnv } from '../providers/adapters/openai-codex/transport/codexSpawn.js';
|
|
17
20
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
21
|
+
const INTELLIGENCE_SCRATCH_DIR_PREFIX = 'instar-codex-intel-scratch-';
|
|
22
|
+
let cachedScratchDir = null;
|
|
23
|
+
/**
|
|
24
|
+
* Lazily create and return an EMPTY scratch directory used as the `--cd`
|
|
25
|
+
* for every judgment call.
|
|
26
|
+
*
|
|
27
|
+
* Running `codex exec` in the agent's project directory loads the full
|
|
28
|
+
* ~26 KB `AGENTS.md` identity AND fires the project's `.codex/hooks.json`
|
|
29
|
+
* hooks (session_start / user_prompt_submit / stop) on every call — turning
|
|
30
|
+
* a one-word classification into a full agent boot. An empty, hook-free
|
|
31
|
+
* scratch dir gives these calls the clean-notepad guarantee that
|
|
32
|
+
* `ClaudeCliIntelligenceProvider` gets via `--setting-sources user`:
|
|
33
|
+
* no project doc, and no project hooks.
|
|
34
|
+
*
|
|
35
|
+
* SECURITY (why mkdtemp, not a fixed name): Codex discovers hooks by walking
|
|
36
|
+
* UP from the cwd and fires any `.codex/hooks.json` it finds — and
|
|
37
|
+
* `project_doc_max_bytes=0` does NOT cover hooks. On Linux `os.tmpdir()` is
|
|
38
|
+
* the world-writable `/tmp`, so a fixed, guessable dir name could be
|
|
39
|
+
* pre-created (or symlinked) by another local user with a planted
|
|
40
|
+
* `.codex/hooks.json`, re-introducing hook execution under our identity.
|
|
41
|
+
* `mkdtempSync` defeats this: it appends an unguessable random suffix, creates
|
|
42
|
+
* the dir with mode 0700 owned by this process, and refuses to follow a
|
|
43
|
+
* pre-existing path — so nothing can be planted in the cwd these calls run in.
|
|
44
|
+
*
|
|
45
|
+
* The dir is re-verified each call: a tmp-reaper may delete it during a
|
|
46
|
+
* long-lived process, so we recreate it if it has gone missing.
|
|
47
|
+
*
|
|
48
|
+
* Bug (2026-05-26): ~1,550 such judgment spawns/day were re-injecting the
|
|
49
|
+
* identity + firing session_start, causing notification spam and spawn-storm
|
|
50
|
+
* delivery failures. Spec: CODEX-INTELLIGENCE-PROVIDER-CLEAN-CALL-SPEC.md.
|
|
51
|
+
*/
|
|
52
|
+
function resolveIntelligenceScratchDir() {
|
|
53
|
+
if (cachedScratchDir && existsSync(cachedScratchDir))
|
|
54
|
+
return cachedScratchDir;
|
|
55
|
+
cachedScratchDir = mkdtempSync(join(tmpdir(), INTELLIGENCE_SCRATCH_DIR_PREFIX));
|
|
56
|
+
return cachedScratchDir;
|
|
57
|
+
}
|
|
18
58
|
export class CodexCliIntelligenceProvider {
|
|
19
59
|
codexPath;
|
|
20
60
|
sandboxMode;
|
|
21
|
-
workingDirectory;
|
|
22
61
|
constructor(options) {
|
|
23
62
|
this.codexPath = options.codexPath;
|
|
24
63
|
this.sandboxMode = options.sandboxMode ?? 'read-only';
|
|
25
|
-
|
|
64
|
+
// options.workingDirectory is intentionally NOT stored: judgment calls
|
|
65
|
+
// always run in an empty scratch dir (resolveIntelligenceScratchDir), so
|
|
66
|
+
// the agent's project identity + hooks never load. The option is retained
|
|
67
|
+
// on the type for API compatibility (the factory still forwards it).
|
|
26
68
|
}
|
|
27
69
|
async evaluate(prompt, options) {
|
|
28
70
|
const model = resolveCliModelFlag(options?.model);
|
|
71
|
+
const scratchDir = resolveIntelligenceScratchDir();
|
|
29
72
|
return new Promise((resolve, reject) => {
|
|
30
73
|
const args = [
|
|
31
74
|
'exec',
|
|
32
75
|
'--model', model,
|
|
33
76
|
'--sandbox', this.sandboxMode,
|
|
34
|
-
|
|
77
|
+
// Run judgment calls in an empty scratch dir, NOT the agent's project
|
|
78
|
+
// dir. The project dir loads the full ~26 KB AGENTS.md identity AND
|
|
79
|
+
// fires the project's .codex/hooks.json (session_start /
|
|
80
|
+
// user_prompt_submit / stop) on every call. The scratch dir is the
|
|
81
|
+
// Codex analog of ClaudeCliIntelligenceProvider's `--setting-sources
|
|
82
|
+
// user`. See resolveIntelligenceScratchDir + the spec.
|
|
83
|
+
'--cd', scratchDir,
|
|
84
|
+
// Belt-and-suspenders: hard-disable project-doc (AGENTS.md) loading
|
|
85
|
+
// even if a stray doc ever lands at or above the scratch path.
|
|
86
|
+
'-c', 'project_doc_max_bytes=0',
|
|
35
87
|
// Reviewer/sentinel/canary calls are deterministic short prompts
|
|
36
88
|
// that don't depend on the cwd being a trusted git repo. Codex
|
|
37
89
|
// CLI's default behavior is to refuse to run when --cd points at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodexCliIntelligenceProvider.js","sourceRoot":"","sources":["../../src/core/CodexCliIntelligenceProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"CodexCliIntelligenceProvider.js","sourceRoot":"","sources":["../../src/core/CodexCliIntelligenceProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4DA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O,CAAC,iCAAiC;IA6DzC,OAAO,CAAC,4BAA4B;IA4LpC;;;;;;;;;;OAUG;IACH;;;;;;;;;;;OAWG;IAEH,gBAAuB,iCAAiC,EAAE,WAAW,CAAC,MAAM,CAAC,CA4B1E;IAEH;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,8BAA8B;IAiHtC,OAAO,CAAC,uBAAuB;IA4B/B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,sBAAsB;IAwC9B,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,8BAA8B;IAoHtC,OAAO,CAAC,+BAA+B;IA+JvC,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,qBAAqB;IA4N7B,OAAO,CAAC,qBAAqB;IA4H7B,OAAO,CAAC,qBAAqB;IA0K7B,OAAO,CAAC,6BAA6B;IAyKrC,OAAO,CAAC,0BAA0B;IAgClC,OAAO,CAAC,gBAAgB;IAmJxB,OAAO,CAAC,6BAA6B;CAoCtC"}
|
|
@@ -2323,18 +2323,20 @@ Threadline activity NEVER spawns a new Telegram topic per event. Notices route o
|
|
|
2323
2323
|
- A conversation **bound to a parent topic** → its real replies surface THERE (handled automatically).
|
|
2324
2324
|
- A **parentless** conversation + any **status/housekeeping** notice → a single, SILENT **"Threadline" hub topic**. It does not buzz the user — agent-to-agent chatter isn't the user's job by default; the hub is a calm, browsable record.
|
|
2325
2325
|
|
|
2326
|
-
When the user is reading the Threadline hub topic and says **"open this"** or **"tie this to <an existing topic>"**,
|
|
2327
|
-
\`\`\`bash
|
|
2328
|
-
# open this → create a fresh topic and bind the conversation (most-recent unbound, or pass threadId)
|
|
2329
|
-
curl -X POST -H "Authorization: Bearer $AUTH" -H 'Content-Type: application/json' http://localhost:${port}/threadline/hub/bind -d '{"action":"open"}'
|
|
2330
|
-
# tie this to an existing topic
|
|
2331
|
-
curl -X POST -H "Authorization: Bearer $AUTH" -H 'Content-Type: application/json' http://localhost:${port}/threadline/hub/bind -d '{"action":"tie","targetTopicId":1234}'
|
|
2332
|
-
\`\`\`
|
|
2333
|
-
After binding, that conversation's future updates flow to the bound topic automatically. If more than one conversation is unbound, the endpoint returns 409 — ask the user which one (pass its \`threadId\`).
|
|
2326
|
+
When the user is reading the Threadline hub topic and says **"open this"** or **"tie this to <an existing topic>"**, this is handled **structurally** — the system intercepts those exact commands in the hub topic and binds the conversation automatically (bare "open this" opens the most-recent one) BEFORE the message reaches me. I will not see "open this" as a message to interpret, and must NOT reply to it conversationally. (Also available as \`POST /threadline/hub/bind\` \`{action:"open"|"tie", ...}\` for scripted use.) After binding, that conversation's future updates flow to the bound topic automatically.
|
|
2334
2327
|
`;
|
|
2335
2328
|
content += '\n' + hubSection;
|
|
2336
2329
|
patched = true;
|
|
2337
|
-
result.upgraded.push('CLAUDE.md: added Threadline hub + "open this"
|
|
2330
|
+
result.upgraded.push('CLAUDE.md: added Threadline hub + "open this" guidance (CMT-519)');
|
|
2331
|
+
}
|
|
2332
|
+
// CMT-529 — agents migrated under CMT-519 got the OLD "call the bind endpoint"
|
|
2333
|
+
// wording; "open this" is now a STRUCTURAL intercept (handled before the agent).
|
|
2334
|
+
// Re-patch the stale sentence so the agent doesn't try to call the endpoint /
|
|
2335
|
+
// reply to a command it will never actually see.
|
|
2336
|
+
if (content.includes('act on it by calling the bind endpoint')) {
|
|
2337
|
+
content = content.replace(/When the user is reading the Threadline hub topic and says \*\*"open this"\*\*[\s\S]*?(?:returns 409 — ask the user which one \(pass its `threadId`\)\.)/, `When the user is reading the Threadline hub topic and says **"open this"** or **"tie this to <an existing topic>"**, this is handled **structurally** — the system intercepts those exact commands and binds the conversation automatically (bare "open this" opens the most-recent one) BEFORE the message reaches me. I will not see "open this" as a message to interpret, and must NOT reply to it conversationally.`);
|
|
2338
|
+
patched = true;
|
|
2339
|
+
result.upgraded.push('CLAUDE.md: updated "open this" guidance to structural-intercept (CMT-529)');
|
|
2338
2340
|
}
|
|
2339
2341
|
// Multi-Session Autonomy awareness (Agent Awareness Standard). Existing
|
|
2340
2342
|
// agents need to know they can run concurrent per-topic autonomous jobs and
|