ghostrail 0.15.0 → 0.15.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/README.md +203 -1
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +64 -40
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/update-diagnosis.d.ts +52 -0
- package/dist/cli/update-diagnosis.d.ts.map +1 -0
- package/dist/cli/update-diagnosis.js +87 -0
- package/dist/cli/update-diagnosis.js.map +1 -0
- package/dist/dashboard/index.d.ts +1 -1
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard/index.js.map +1 -1
- package/dist/dashboard/server.d.ts +20 -1
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +17 -4
- package/dist/dashboard/server.js.map +1 -1
- package/dist/factory/state.d.ts +1 -0
- package/dist/factory/state.d.ts.map +1 -1
- package/dist/factory/state.js +44 -1
- package/dist/factory/state.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/global/index.d.ts.map +1 -1
- package/dist/global/index.js +1 -1
- package/dist/global/index.js.map +1 -1
- package/dist/global/registry.d.ts +46 -0
- package/dist/global/registry.d.ts.map +1 -1
- package/dist/global/registry.js +63 -2
- package/dist/global/registry.js.map +1 -1
- package/package.json +1 -1
- package/skill/ghostrail/SKILL.md +24 -4
package/dist/factory/state.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/factory/state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/factory/state.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,4EAA4E;AAC5E,eAAO,MAAM,gBAAg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;GAQG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB,GAAG,OAAO,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAwB5C;AAmBD,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,SAAuB,EAC5B,IAAI,GAAE,MAAkB,GACvB,OAAO,CAAC,MAAM,CAAC,CAOjB"}
|
package/dist/factory/state.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { cp, readdir, stat } from "node:fs/promises";
|
|
1
|
+
import { cp, readFile, readdir, stat } from "node:fs/promises";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { spawnCollect } from "../backend/proc.js";
|
|
6
|
+
import { parseConfig } from "../config/load.js";
|
|
6
7
|
import { canonicalRepoId, localRepoId } from "../global/repo-id.js";
|
|
7
8
|
import { repoStateDir } from "../global/state-dir.js";
|
|
8
9
|
import { ensureManagedCheckout } from "./checkout.js";
|
|
@@ -154,4 +155,46 @@ export async function resolveWorkRepo(options) {
|
|
|
154
155
|
...(result.fetched ? {} : { note: `could not fetch ${source}; runs branch from a stale base` }),
|
|
155
156
|
};
|
|
156
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* A repo's state directory, resolved the way a run resolves it, from the repo
|
|
160
|
+
* itself.
|
|
161
|
+
*
|
|
162
|
+
* The dashboard needs the same answer the watcher reaches, and reaching it
|
|
163
|
+
* means reading the config for `[factory].source` and otherwise asking git for
|
|
164
|
+
* the origin. Deriving it from the registry instead is what made the two
|
|
165
|
+
* disagree: a registry entry written before repo identities has no `repo`, and
|
|
166
|
+
* falling back to its path keys a directory nothing ever writes to.
|
|
167
|
+
*
|
|
168
|
+
* Memoised for the life of the process. A listing asks per ghostrail per
|
|
169
|
+
* request, and a repo's origin does not change between two page refreshes. A
|
|
170
|
+
* rename is picked up on the next restart, which is the same freshness the
|
|
171
|
+
* registry itself has.
|
|
172
|
+
*/
|
|
173
|
+
const stateDirMemo = new Map();
|
|
174
|
+
export async function resolveStateDir(repoPath, env = process.env, home = homedir()) {
|
|
175
|
+
const memo = stateDirMemo.get(repoPath);
|
|
176
|
+
if (memo !== undefined)
|
|
177
|
+
return memo;
|
|
178
|
+
const config = await configAt(repoPath);
|
|
179
|
+
const { dir } = await stateDirFor(repoPath, config, env, home);
|
|
180
|
+
stateDirMemo.set(repoPath, dir);
|
|
181
|
+
return dir;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* A repo's parsed config, or undefined when it has none or it does not parse.
|
|
185
|
+
*
|
|
186
|
+
* Best-effort: a surface that only reads state should still work against a repo
|
|
187
|
+
* whose config is mid-edit, falling back to keying on the checkout's origin.
|
|
188
|
+
*/
|
|
189
|
+
async function configAt(repoPath) {
|
|
190
|
+
let raw;
|
|
191
|
+
try {
|
|
192
|
+
raw = await readFile(join(repoPath, "ghostrail.toml"), "utf8");
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
const parsed = parseConfig(raw);
|
|
198
|
+
return parsed.ok ? parsed.value : undefined;
|
|
199
|
+
}
|
|
157
200
|
//# sourceMappingURL=state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/factory/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/factory/state.ts"],"names":[],"mappings":"AAAA,OAAO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AAC;AAC9C,CAAC"}
|
package/dist/global/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type Ghostrail, REGISTRY_FILE, entryKey, findByKey, findByPath, parseRegistry, renderRegistry, upsert, } from "./registry.js";
|
|
1
|
+
export { type Ghostrail, REGISTRY_FILE, entryKey, findByKey, findByPath, findForRepo, findForRepoResolving, parseRegistry, renderRegistry, replaceEntry, upsert, } from "./registry.js";
|
|
2
2
|
export { canonicalRepoId, isLocalRepoId, localRepoId, repoKey } from "./repo-id.js";
|
|
3
3
|
export { repoStateDir, stateHome } from "./state-dir.js";
|
|
4
4
|
export { artifactFileName, type GlobalEnv, GlobalStore, resolveGlobalDir } from "./store.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/global/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,aAAa,EACb,QAAQ,EACR,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,KAAK,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/global/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,aAAa,EACb,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,KAAK,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/global/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { REGISTRY_FILE, entryKey, findByKey, findByPath, parseRegistry, renderRegistry, upsert, } from "./registry.js";
|
|
1
|
+
export { REGISTRY_FILE, entryKey, findByKey, findByPath, findForRepo, findForRepoResolving, parseRegistry, renderRegistry, replaceEntry, upsert, } from "./registry.js";
|
|
2
2
|
export { canonicalRepoId, isLocalRepoId, localRepoId, repoKey } from "./repo-id.js";
|
|
3
3
|
export { repoStateDir, stateHome } from "./state-dir.js";
|
|
4
4
|
export { artifactFileName, GlobalStore, resolveGlobalDir } from "./store.js";
|
package/dist/global/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/global/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,UAAU,EACV,aAAa,EACb,cAAc,EACd,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAkB,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/global/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAkB,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -81,6 +81,38 @@ export declare function entryKey(entry: Ghostrail): string;
|
|
|
81
81
|
export declare function findByPath(entries: readonly Ghostrail[], path: string): Ghostrail | undefined;
|
|
82
82
|
/** The entry for a repo identity (or a path, for an entry that has none). */
|
|
83
83
|
export declare function findByKey(entries: readonly Ghostrail[], key: string): Ghostrail | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* The entry for this repo, whether or not it knows its own identity yet.
|
|
86
|
+
*
|
|
87
|
+
* By identity first, then by path. The path fallback exists for one case: an
|
|
88
|
+
* entry written before identities did, which can never match a lookup by
|
|
89
|
+
* identity because its key *is* its path. Without it, registering a repo that
|
|
90
|
+
* is already registered appends a second entry, and two entries for one repo
|
|
91
|
+
* each get a service unit, which is the failure this whole change removes,
|
|
92
|
+
* arriving by way of the upgrade rather than a second clone.
|
|
93
|
+
*
|
|
94
|
+
* The order matters and is not interchangeable. Two checkouts of one repo must
|
|
95
|
+
* resolve to the identity match; falling to the path first would give each
|
|
96
|
+
* checkout its own answer again.
|
|
97
|
+
*/
|
|
98
|
+
export declare function findForRepo(entries: readonly Ghostrail[], repoId: string, path: string): Ghostrail | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* {@link findForRepo}, extended to recognise a legacy entry registered at a
|
|
101
|
+
* *different* checkout of the same repo.
|
|
102
|
+
*
|
|
103
|
+
* The pure version can only match a legacy entry by its path, so registering
|
|
104
|
+
* from a second checkout while the registry is still legacy would miss it and
|
|
105
|
+
* append: one repo, two entries, two units, which is the whole failure again.
|
|
106
|
+
* Deciding whether some other directory is the same repo means asking git what
|
|
107
|
+
* its origin is, so the resolver is injected rather than imported and this
|
|
108
|
+
* stays testable without a filesystem.
|
|
109
|
+
*
|
|
110
|
+
* Only legacy entries are resolved. One with an identity already answered for
|
|
111
|
+
* itself, and re-deriving it would turn a registry read into a subprocess per
|
|
112
|
+
* ghostrail. A path that no longer exists resolves to its own `local:` identity
|
|
113
|
+
* and simply does not match, so a deleted checkout cannot produce a false hit.
|
|
114
|
+
*/
|
|
115
|
+
export declare function findForRepoResolving(entries: readonly Ghostrail[], repoId: string, path: string, resolveRepoId: (path: string) => Promise<string>): Promise<Ghostrail | undefined>;
|
|
84
116
|
/**
|
|
85
117
|
* Add `entry`, or replace the one with the same identity.
|
|
86
118
|
*
|
|
@@ -93,4 +125,18 @@ export declare function findByKey(entries: readonly Ghostrail[], key: string): G
|
|
|
93
125
|
* rather than a move; a new entry appends. Neither argument is mutated.
|
|
94
126
|
*/
|
|
95
127
|
export declare function upsert(entries: readonly Ghostrail[], entry: Ghostrail): Ghostrail[];
|
|
128
|
+
/**
|
|
129
|
+
* Replace the entry keyed `previousKey` with `entry`, or append when there is
|
|
130
|
+
* none.
|
|
131
|
+
*
|
|
132
|
+
* Needed because adopting a legacy entry *changes its key*: it was keyed on its
|
|
133
|
+
* path, and gaining a repo identity re-keys it. `upsert` looks up by the new
|
|
134
|
+
* entry's own key, finds nothing, and appends, leaving one repo with two
|
|
135
|
+
* entries and therefore two service units. The caller already knows which entry
|
|
136
|
+
* it means, so it says so.
|
|
137
|
+
*
|
|
138
|
+
* A replacement keeps its position, so a diff of the file shows a changed block
|
|
139
|
+
* rather than a move. Neither argument is mutated.
|
|
140
|
+
*/
|
|
141
|
+
export declare function replaceEntry(entries: readonly Ghostrail[], previousKey: string, entry: Ghostrail): Ghostrail[];
|
|
96
142
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/global/registry.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,sCAAsC;AACtC,MAAM,WAAW,SAAS;IACxB,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,uCAAuC;AACvC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AA2B/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,SAAS,CA4BnE;AAOD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,CAcpE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED,uFAAuF;AACvF,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE7F;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE3F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,E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,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAC/C,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAQhC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,CAEnF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,SAAS,SAAS,EAAE,EAC7B,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,GACf,SAAS,EAAE,CAMb"}
|
package/dist/global/registry.js
CHANGED
|
@@ -123,6 +123,52 @@ export function findByPath(entries, path) {
|
|
|
123
123
|
export function findByKey(entries, key) {
|
|
124
124
|
return entries.find((entry) => entryKey(entry) === key);
|
|
125
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* The entry for this repo, whether or not it knows its own identity yet.
|
|
128
|
+
*
|
|
129
|
+
* By identity first, then by path. The path fallback exists for one case: an
|
|
130
|
+
* entry written before identities did, which can never match a lookup by
|
|
131
|
+
* identity because its key *is* its path. Without it, registering a repo that
|
|
132
|
+
* is already registered appends a second entry, and two entries for one repo
|
|
133
|
+
* each get a service unit, which is the failure this whole change removes,
|
|
134
|
+
* arriving by way of the upgrade rather than a second clone.
|
|
135
|
+
*
|
|
136
|
+
* The order matters and is not interchangeable. Two checkouts of one repo must
|
|
137
|
+
* resolve to the identity match; falling to the path first would give each
|
|
138
|
+
* checkout its own answer again.
|
|
139
|
+
*/
|
|
140
|
+
export function findForRepo(entries, repoId, path) {
|
|
141
|
+
return (findByKey(entries, repoId) ??
|
|
142
|
+
entries.find((entry) => entry.repo === undefined && entry.path === path));
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* {@link findForRepo}, extended to recognise a legacy entry registered at a
|
|
146
|
+
* *different* checkout of the same repo.
|
|
147
|
+
*
|
|
148
|
+
* The pure version can only match a legacy entry by its path, so registering
|
|
149
|
+
* from a second checkout while the registry is still legacy would miss it and
|
|
150
|
+
* append: one repo, two entries, two units, which is the whole failure again.
|
|
151
|
+
* Deciding whether some other directory is the same repo means asking git what
|
|
152
|
+
* its origin is, so the resolver is injected rather than imported and this
|
|
153
|
+
* stays testable without a filesystem.
|
|
154
|
+
*
|
|
155
|
+
* Only legacy entries are resolved. One with an identity already answered for
|
|
156
|
+
* itself, and re-deriving it would turn a registry read into a subprocess per
|
|
157
|
+
* ghostrail. A path that no longer exists resolves to its own `local:` identity
|
|
158
|
+
* and simply does not match, so a deleted checkout cannot produce a false hit.
|
|
159
|
+
*/
|
|
160
|
+
export async function findForRepoResolving(entries, repoId, path, resolveRepoId) {
|
|
161
|
+
const direct = findForRepo(entries, repoId, path);
|
|
162
|
+
if (direct !== undefined)
|
|
163
|
+
return direct;
|
|
164
|
+
for (const entry of entries) {
|
|
165
|
+
if (entry.repo !== undefined)
|
|
166
|
+
continue;
|
|
167
|
+
if ((await resolveRepoId(entry.path)) === repoId)
|
|
168
|
+
return entry;
|
|
169
|
+
}
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
126
172
|
/**
|
|
127
173
|
* Add `entry`, or replace the one with the same identity.
|
|
128
174
|
*
|
|
@@ -135,8 +181,23 @@ export function findByKey(entries, key) {
|
|
|
135
181
|
* rather than a move; a new entry appends. Neither argument is mutated.
|
|
136
182
|
*/
|
|
137
183
|
export function upsert(entries, entry) {
|
|
138
|
-
|
|
139
|
-
|
|
184
|
+
return replaceEntry(entries, entryKey(entry), entry);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Replace the entry keyed `previousKey` with `entry`, or append when there is
|
|
188
|
+
* none.
|
|
189
|
+
*
|
|
190
|
+
* Needed because adopting a legacy entry *changes its key*: it was keyed on its
|
|
191
|
+
* path, and gaining a repo identity re-keys it. `upsert` looks up by the new
|
|
192
|
+
* entry's own key, finds nothing, and appends, leaving one repo with two
|
|
193
|
+
* entries and therefore two service units. The caller already knows which entry
|
|
194
|
+
* it means, so it says so.
|
|
195
|
+
*
|
|
196
|
+
* A replacement keeps its position, so a diff of the file shows a changed block
|
|
197
|
+
* rather than a move. Neither argument is mutated.
|
|
198
|
+
*/
|
|
199
|
+
export function replaceEntry(entries, previousKey, entry) {
|
|
200
|
+
const index = entries.findIndex((existing) => entryKey(existing) === previousKey);
|
|
140
201
|
if (index === -1)
|
|
141
202
|
return [...entries, entry];
|
|
142
203
|
const next = [...entries];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/global/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AA2C/C,uCAAuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE/C,MAAM,MAAM,GAAG;;;;;;;oEAOqD,CAAC;AAErE,kEAAkE;AAClE,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,+EAA+E;AAC/E,SAAS,UAAU,CAAC,GAAY;IAC9B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC;IAC/C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC3E,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC9E,8EAA8E;IAC9E,IAAI,IAAI,KAAK,SA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E,KAAK,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IACpB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
package/skill/ghostrail/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ user-invocable: true
|
|
|
5
5
|
argument-hint: "[customize | init | update | doctor | status | run | respond | triage]"
|
|
6
6
|
license: Apache-2.0
|
|
7
7
|
metadata:
|
|
8
|
-
version: 0.
|
|
8
|
+
version: 0.4.0
|
|
9
9
|
allowed-tools:
|
|
10
10
|
- Read
|
|
11
11
|
- Write
|
|
@@ -68,6 +68,13 @@ this tailors them to *this* repo. Never guess: read before proposing.
|
|
|
68
68
|
they should be. Ask rather than invent tracker identifiers.
|
|
69
69
|
4. **Do not touch** `[output].auto_merge` (it must stay `false`) or invent
|
|
70
70
|
credentials.
|
|
71
|
+
5. **Never run `<GR> run`, `<GR> triage`, or `<GR> respond` to check your edits.**
|
|
72
|
+
Those act on real tracker items, per the confirm-first rule under **run ·
|
|
73
|
+
respond · triage** below, and that rule has no "just checking" exception:
|
|
74
|
+
zero eligible items still means the command executed for real. If you want
|
|
75
|
+
to confirm `ghostrail.toml` still parses, read it back and reason about it,
|
|
76
|
+
or ask the user before running anything beyond `<GR> --help`-style
|
|
77
|
+
inspection; do not treat execution as a substitute for reading.
|
|
71
78
|
|
|
72
79
|
State plainly what you changed and what still needs a human (tracker IDs, tokens).
|
|
73
80
|
|
|
@@ -160,8 +167,14 @@ Two things to tell the user plainly:
|
|
|
160
167
|
Diagnose a setup without changing anything. Check and report each, with the fix:
|
|
161
168
|
|
|
162
169
|
- **CLI** — which form resolved, and its `<GR> version`.
|
|
163
|
-
- **Config** — `ghostrail.toml` present, and it parses.
|
|
164
|
-
|
|
170
|
+
- **Config** — `ghostrail.toml` present, and it parses. Read it yourself first:
|
|
171
|
+
most syntax and shape problems (bad TOML, a misnamed table, a wrong type) are
|
|
172
|
+
visible without running anything. Only `<GR> run`, `<GR> triage`, and
|
|
173
|
+
`<GR> respond` surface the dotted-path parse error the CLI produces, and they
|
|
174
|
+
execute for real even with zero eligible items, so getting that message is
|
|
175
|
+
not a free action — treat it exactly like the "run · respond · triage"
|
|
176
|
+
section requires: state what you're about to do and get confirmation first,
|
|
177
|
+
never run one silently "just to check parsing."
|
|
165
178
|
- **Prompts** — every path referenced by `[agent].prompt`, `[respond].prompt`,
|
|
166
179
|
and `[triage].prompt` exists.
|
|
167
180
|
- **Gate** — `[gate].commands` is non-empty for a code factory, and the commands
|
|
@@ -199,7 +212,10 @@ view, suggest `<GR> board`.
|
|
|
199
212
|
## run · respond · triage
|
|
200
213
|
|
|
201
214
|
Passthroughs. Before executing, state what will happen and confirm, because these
|
|
202
|
-
act on real tracker items and can open real pull requests.
|
|
215
|
+
act on real tracker items and can open real pull requests. This confirmation is
|
|
216
|
+
required every time, including when the only goal is to see whether config
|
|
217
|
+
parses or a prompt renders: "0 eligible items, nothing happened" is still a
|
|
218
|
+
real execution, not a no-op you were entitled to skip asking about.
|
|
203
219
|
|
|
204
220
|
- `run` — one tick over the fix queue. **If `[output].open_pr` is true, this opens
|
|
205
221
|
a real PR.** Suggest a dry run first (`open_pr = false`) for a new setup.
|
|
@@ -216,6 +232,10 @@ and any PR URL. On failure, quote the actual error rather than paraphrasing.
|
|
|
216
232
|
|
|
217
233
|
- **Never** set `auto_merge = true` or merge a factory PR. A human owns merges.
|
|
218
234
|
- **Never** print or commit a secret. Report credentials as set/unset only.
|
|
235
|
+
- **Never** run `run`, `triage`, or `respond` without asking first, including
|
|
236
|
+
from inside **customize**, **init**, **update**, or **doctor** — verifying
|
|
237
|
+
that a config or prompt change is well-formed is never a reason to skip the
|
|
238
|
+
confirmation those commands require.
|
|
219
239
|
- Prefer editing the scaffolded prompts over rewriting them; they already encode
|
|
220
240
|
the `.ghostrail/result.json` and `.ghostrail/triage.json` contracts the factory
|
|
221
241
|
depends on, and breaking those breaks the loop.
|