principles-disciple 1.21.0 → 1.22.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/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -56,6 +56,11 @@ import {
|
|
|
56
56
|
import {
|
|
57
57
|
getCheckpoint,
|
|
58
58
|
} from '../core/model-training-registry.js';
|
|
59
|
+
import {
|
|
60
|
+
runMergeGateAudit,
|
|
61
|
+
formatMergeGateAuditReport,
|
|
62
|
+
} from '../core/merge-gate-audit.js';
|
|
63
|
+
import { resolvePdPath } from '../core/paths.js';
|
|
59
64
|
|
|
60
65
|
function isZh(ctx: PluginCommandContext): boolean {
|
|
61
66
|
return String(ctx.config?.language || 'en').startsWith('zh');
|
|
@@ -257,6 +262,14 @@ ${result.passes
|
|
|
257
262
|
return { text };
|
|
258
263
|
}
|
|
259
264
|
|
|
265
|
+
// ── Merge-Gate Audit ──────────────────────────────────────────────────
|
|
266
|
+
if (subcommand === 'audit') {
|
|
267
|
+
const stateDir = resolvePdPath(workspaceDir, 'STATE_DIR');
|
|
268
|
+
const report = runMergeGateAudit(workspaceDir, stateDir);
|
|
269
|
+
const formatted = formatMergeGateAuditReport(report);
|
|
270
|
+
return { text: formatted };
|
|
271
|
+
}
|
|
272
|
+
|
|
260
273
|
// ── Advance Promotion ─────────────────────────────────────────────────
|
|
261
274
|
if (subcommand === 'advance-promotion') {
|
|
262
275
|
const checkpointId = parts[1] || checkpointIdArg;
|
|
@@ -267,6 +280,28 @@ ${result.passes
|
|
|
267
280
|
const profile = parseProfile(profileArg);
|
|
268
281
|
const hasReview = args.includes('--review');
|
|
269
282
|
const noteArg = parts.find((p) => p.startsWith('--note='))?.split('=')[1];
|
|
283
|
+
const skipAudit = args.includes('--skip-audit');
|
|
284
|
+
|
|
285
|
+
// ── Merge-gate auto-gate: block advance-promotion if audit is BLOCK ──
|
|
286
|
+
if (!skipAudit) {
|
|
287
|
+
const stateDir = resolvePdPath(workspaceDir, 'STATE_DIR');
|
|
288
|
+
const auditReport = runMergeGateAudit(workspaceDir, stateDir);
|
|
289
|
+
if (auditReport.overallStatus === 'block') {
|
|
290
|
+
return {
|
|
291
|
+
text: zh
|
|
292
|
+
? `❌ Merge-Gate 审计阻止了晋升:发现 ${auditReport.counts.block} 个阻断项
|
|
293
|
+
|
|
294
|
+
${formatMergeGateAuditReport(auditReport)}
|
|
295
|
+
|
|
296
|
+
如需强制晋升,请添加 --skip-audit 标志。`
|
|
297
|
+
: `❌ Merge-Gate audit blocked promotion: ${auditReport.counts.block} blocking issue(s) found
|
|
298
|
+
|
|
299
|
+
${formatMergeGateAuditReport(auditReport)}
|
|
300
|
+
|
|
301
|
+
To force promotion, add --skip-audit flag.`,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
270
305
|
|
|
271
306
|
try {
|
|
272
307
|
const promotion = advancePromotion(workspaceDir, {
|