@ouro.bot/cli 0.1.0-alpha.290 → 0.1.0-alpha.291
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/changelog.json +6 -0
- package/dist/repertoire/coding/manager.js +10 -9
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.291",
|
|
6
|
+
"changes": [
|
|
7
|
+
"fix(coding): eliminate silent `~/AgentBundles/default.ouro` real-fs leak in the coding session manager. Root cause: `src/repertoire/coding/manager.ts` had a `safeAgentName()` helper that caught `getAgentName()` throws (which happens in vitest because there's no `--agent` in argv) and silently fell back to `\"default\"`. Combined with `src/repertoire/coding/index.ts:8` constructing the singleton as `new CodingSessionManager({})` (no options — real fs, no agentName), every vitest run that called `getCodingSessionManager()` followed by `resetCodingSessionManager()` triggered `shutdown()` → `persistState()` → `fs.mkdirSync('~/AgentBundles/default.ouro/state/coding', { recursive: true })` + `fs.writeFileSync('.../sessions.json', ...)`. This wrote real files under the developer's home directory on every coverage-gate run. The observable symptom was `~/AgentBundles/default.ouro/` reappearing minutes after `rm -rf` — PR B's housekeeping cleanup couldn't stick. Fix: deleted `safeAgentName()` and made the constructor's `agentName` default call `getAgentName()` directly, so construction fails loudly in vitest when identity isn't mocked. Updated `index.test.ts` to mock both `../../../heart/identity` and `fs` so the singleton can be tested without touching real disk. Updated `session-manager.test.ts`, `session-manager-branches.test.ts`, and `session-manager-persistence.test.ts` to either inline `agentName: \"test-coding-agent\"` in `noPersistence` or mock `../../../heart/identity` at file top. One persistence test assertion updated from `parentAgent === \"default\"` to `\"test-coding-agent\"`. Full coverage gate passes, 171 coding tests pass, `~/AgentBundles/default.ouro` stays deleted across 3 consecutive coverage-gate runs."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.290",
|
|
6
12
|
"changes": [
|
|
@@ -39,14 +39,6 @@ const path = __importStar(require("path"));
|
|
|
39
39
|
const identity_1 = require("../../heart/identity");
|
|
40
40
|
const runtime_1 = require("../../nerves/runtime");
|
|
41
41
|
const spawner_1 = require("./spawner");
|
|
42
|
-
function safeAgentName() {
|
|
43
|
-
try {
|
|
44
|
-
return (0, identity_1.getAgentName)();
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
return "default";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
42
|
function defaultStateFilePath(agentName) {
|
|
51
43
|
return path.join((0, identity_1.getAgentRoot)(agentName), "state", "coding", "sessions.json");
|
|
52
44
|
}
|
|
@@ -186,7 +178,16 @@ class CodingSessionManager {
|
|
|
186
178
|
this.writeFileSync = options.writeFileSync ?? fs.writeFileSync;
|
|
187
179
|
this.mkdirSync = options.mkdirSync ?? fs.mkdirSync;
|
|
188
180
|
this.pidAlive = options.pidAlive ?? isPidAlive;
|
|
189
|
-
|
|
181
|
+
// No silent fallback to "default" — if there's no agentName and no
|
|
182
|
+
// explicit option, getAgentName() throws. The previous `safeAgentName`
|
|
183
|
+
// helper fell back to "default" and ended up writing coding session
|
|
184
|
+
// state to `~/AgentBundles/default.ouro/state/coding/sessions.json` on
|
|
185
|
+
// every vitest run because the coding manager singleton constructs with
|
|
186
|
+
// `{}`. That leaked real-fs state into the developer's home directory
|
|
187
|
+
// on every coverage run. Production callers always pass via argv (see
|
|
188
|
+
// getAgentName); test callers must either pass `agentName` explicitly
|
|
189
|
+
// or mock `../../heart/identity`.
|
|
190
|
+
this.agentName = options.agentName ?? (0, identity_1.getAgentName)();
|
|
190
191
|
this.stateFilePath = options.stateFilePath ?? defaultStateFilePath(this.agentName);
|
|
191
192
|
this.artifactDirPath = options.artifactDirPath
|
|
192
193
|
?? (options.stateFilePath ? path.dirname(options.stateFilePath) : defaultArtifactDirPath(this.agentName));
|