mandrel 2.82.0 → 2.84.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/.agents/README.md +65 -20
- package/.agents/docs/configuration.md +40 -3
- package/.agents/docs/runbooks/mods.md +98 -54
- package/.agents/docs/workflows.md +14 -0
- package/.agents/instructions.md +4 -1
- package/.agents/mods/mandrel-status/hooks/register.tsx +579 -204
- package/.agents/mods/mandrel-status/types/index.d.ts +58 -13
- package/.agents/schemas/agentrc.schema.json +1 -1
- package/.agents/scripts/boot-sweep.js +42 -13
- package/.agents/scripts/coverage-capture.js +55 -24
- package/.agents/scripts/evidence-gate.js +7 -1
- package/.agents/scripts/generate-workflows-doc.js +14 -0
- package/.agents/scripts/lib/baselines/duplication-scanner.js +26 -2
- package/.agents/scripts/lib/bootstrap/agents-md-fold.js +99 -16
- package/.agents/scripts/lib/bootstrap/manifest.js +4 -4
- package/.agents/scripts/lib/bootstrap/project-bootstrap.js +16 -1
- package/.agents/scripts/lib/close-lock-events.js +109 -0
- package/.agents/scripts/lib/close-validation/commands.js +12 -0
- package/.agents/scripts/lib/close-validation/gates.js +6 -0
- package/.agents/scripts/lib/close-validation/process.js +5 -2
- package/.agents/scripts/lib/close-validation/runner.js +14 -4
- package/.agents/scripts/lib/codex/agents-projection.js +284 -0
- package/.agents/scripts/lib/codex/skills-projection.js +291 -0
- package/.agents/scripts/lib/config/agentrc-overlay.js +91 -0
- package/.agents/scripts/lib/config/sync-agentrc.js +39 -19
- package/.agents/scripts/lib/config-resolver.js +5 -42
- package/.agents/scripts/lib/config-settings-schema-quality.js +1 -1
- package/.agents/scripts/lib/config-settings-schema.js +1 -1
- package/.agents/scripts/lib/full-suite-lock.js +20 -0
- package/.agents/scripts/lib/full-suite-queue.js +24 -56
- package/.agents/scripts/lib/generated/agentrc-validator.js +1 -1
- package/.agents/scripts/lib/observability/source-classifier.js +2 -0
- package/.agents/scripts/lib/orchestration/review-providers/codex-cli.js +152 -0
- package/.agents/scripts/lib/orchestration/review-providers/codex.js +33 -105
- package/.agents/scripts/lib/orchestration/review-providers/provider-severity.js +30 -0
- package/.agents/scripts/lib/orchestration/review-providers/security-review.js +3 -17
- package/.agents/scripts/lib/orchestration/single-story-close/phases/close-validation.js +73 -63
- package/.agents/scripts/lib/orchestration/single-story-close/phases/reconcile-done.js +70 -0
- package/.agents/scripts/lib/orchestration/single-story-close/runner.js +3 -0
- package/.agents/scripts/lib/single-story-sweep/reconcile-closing.js +89 -0
- package/.agents/scripts/lib/supervised-suite.js +8 -28
- package/.agents/scripts/single-story-init.js +20 -5
- package/.agents/scripts/sync-agentrc.js +5 -3
- package/.agents/scripts/sync-claude-agents.js +20 -0
- package/.agents/scripts/sync-claude-commands.js +64 -27
- package/.agents/scripts/sync-codex-agents.js +36 -0
- package/.agents/scripts/sync-codex-skills.js +36 -0
- package/.agents/workflows/helpers/mandrel-sync-config.md +16 -9
- package/.agents/workflows/mandrel-update.md +2 -1
- package/README.md +167 -216
- package/docs/CHANGELOG.md +25 -0
- package/lib/cli/guarded-sync.js +3 -2
- package/lib/cli/registry.js +248 -0
- package/lib/cli/sync-agents.js +5 -2
- package/lib/cli/sync-commands.js +5 -2
- package/lib/cli/sync.js +45 -14
- package/lib/cli/uninstall.js +8 -1
- package/lib/migrations/index.js +2 -0
- package/lib/migrations/steps/2.84.0-hoist-system-prompt-block.js +64 -0
- package/package.json +3 -2
|
@@ -167,50 +167,6 @@ function describeHolder({ ownerId, pid, ageSeconds }) {
|
|
|
167
167
|
return `holder ${ownerId ?? 'unknown'}, pid ${pid ?? 'unknown'}, lock age ${ageSeconds ?? 'unknown'}s`;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
const HOLDER_RE =
|
|
171
|
-
/holder ([^,\s]+), pid (\d+|unknown), lock age (\d+|unknown)s/u;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Log lines are the one channel that reaches close from a child capture.
|
|
175
|
-
*
|
|
176
|
-
* @param {string} line
|
|
177
|
-
* @returns {{ waitedSeconds: number, expired: boolean, holder?: LockHolder }|null}
|
|
178
|
-
*/
|
|
179
|
-
export function parseLockWaitOutcome(line) {
|
|
180
|
-
const text = String(line ?? '');
|
|
181
|
-
const match = /\[full-suite-lock\] (✅|⌛) [^\n]*\(waited (\d+)s[,)]/u.exec(
|
|
182
|
-
text,
|
|
183
|
-
);
|
|
184
|
-
if (!match) return null;
|
|
185
|
-
return withHolder(
|
|
186
|
-
{ waitedSeconds: Number(match[2]), expired: match[1] === '⌛' },
|
|
187
|
-
text,
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/** An expiry line also names the holder it gave up on. */
|
|
192
|
-
function withHolder(outcome, text) {
|
|
193
|
-
const holder = outcome.expired ? HOLDER_RE.exec(text) : null;
|
|
194
|
-
if (!holder) return outcome;
|
|
195
|
-
const [, ownerId, pid, ageSeconds] = holder.map(unknownAsNull);
|
|
196
|
-
return {
|
|
197
|
-
...outcome,
|
|
198
|
-
holder: {
|
|
199
|
-
ownerId,
|
|
200
|
-
pid: numberOrNull(pid),
|
|
201
|
-
ageSeconds: numberOrNull(ageSeconds),
|
|
202
|
-
},
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function unknownAsNull(raw) {
|
|
207
|
-
return raw === 'unknown' ? null : raw;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function numberOrNull(raw) {
|
|
211
|
-
return raw === null ? null : Number(raw);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
170
|
function holderLabel(lockPath, fsImpl) {
|
|
215
171
|
return `holding pid ${readLockHolderPid(lockPath, fsImpl) ?? 'unknown'}`;
|
|
216
172
|
}
|
|
@@ -225,17 +181,9 @@ function holderLabel(lockPath, fsImpl) {
|
|
|
225
181
|
* @returns {Promise<{ held: object|null, expired: boolean, waited: true, waitedMs: number, holder?: LockHolder }>}
|
|
226
182
|
*/
|
|
227
183
|
export async function waitInLine(opts) {
|
|
228
|
-
const { lockPath,
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
deadline: startedAt + Math.max(0, waitMs),
|
|
232
|
-
nextReport: startedAt + opts.reportMs,
|
|
233
|
-
waitedMs: () => Math.max(0, nowFn() - startedAt),
|
|
234
|
-
waited: () => Math.round((nowFn() - startedAt) / 1000),
|
|
235
|
-
};
|
|
236
|
-
log(
|
|
237
|
-
`${LOCK_TAG} ⏳ another full suite is already running on this host (${holderLabel(lockPath, fsImpl)}) — waiting up to ${Math.round(waitMs / 1000)}s for it to finish before spawning.`,
|
|
238
|
-
);
|
|
184
|
+
const { lockPath, fsImpl, nowFn } = opts;
|
|
185
|
+
const clock = waitClock(opts);
|
|
186
|
+
announceWait(opts);
|
|
239
187
|
const ticket = enqueueWaiter({ lockPath, nowFn, fsImpl });
|
|
240
188
|
try {
|
|
241
189
|
const outcome = await pollForTurn(opts, ticket, clock);
|
|
@@ -244,9 +192,29 @@ export async function waitInLine(opts) {
|
|
|
244
192
|
} finally {
|
|
245
193
|
dequeueWaiter(ticket, { fsImpl });
|
|
246
194
|
}
|
|
195
|
+
return giveUp(opts, clock);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function waitClock({ waitMs, reportMs, nowFn }) {
|
|
199
|
+
const startedAt = nowFn();
|
|
200
|
+
return {
|
|
201
|
+
deadline: startedAt + Math.max(0, waitMs),
|
|
202
|
+
nextReport: startedAt + reportMs,
|
|
203
|
+
waitedMs: () => Math.max(0, nowFn() - startedAt),
|
|
204
|
+
waited: () => Math.round((nowFn() - startedAt) / 1000),
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function announceWait({ lockPath, waitMs, fsImpl, log }) {
|
|
209
|
+
log(
|
|
210
|
+
`${LOCK_TAG} ⏳ another full suite is already running on this host (${holderLabel(lockPath, fsImpl)}) — waiting up to ${Math.round(waitMs / 1000)}s for it to finish before spawning.`,
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function giveUp({ lockPath, fsImpl, nowFn, log, rerunCommand }, clock) {
|
|
247
215
|
const holder = readLockHolder(lockPath, { fsImpl, nowFn });
|
|
248
216
|
log(
|
|
249
|
-
`${LOCK_TAG} ⌛ gave up waiting for the full-suite lock (waited ${clock.waited()}s, ${describeHolder(holder)}) — not spawning, so two full suites never overlap. Re-run once it finishes: ${
|
|
217
|
+
`${LOCK_TAG} ⌛ gave up waiting for the full-suite lock (waited ${clock.waited()}s, ${describeHolder(holder)}) — not spawning, so two full suites never overlap. Re-run once it finishes: ${rerunCommand}`,
|
|
250
218
|
);
|
|
251
219
|
return {
|
|
252
220
|
held: null,
|