@codyswann/lisa 4.60.8 → 4.60.10
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/all/copy-overwrite/scripts/lisa-gates.mjs +9 -8
- package/all/copy-overwrite/scripts/lisa-hooks/block-instruction-file-edits.sh +26 -35
- package/all/create-only/.agents/rules/README.md +13 -6
- package/dist/core/host-rules-pointer.js +2 -2
- package/dist/core/host-rules-pointer.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +4 -0
- package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/nightly-e2e-guard-behavior-certificate.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +8 -6
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +3 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/preserve-verification-opt-ins.d.ts +41 -0
- package/dist/migrations/preserve-verification-opt-ins.d.ts.map +1 -0
- package/dist/migrations/preserve-verification-opt-ins.js +244 -0
- package/dist/migrations/preserve-verification-opt-ins.js.map +1 -0
- package/dist/opencode/plugin-templates/lisa-block-instruction-file-edits.ts +25 -22
- package/package.json +4 -4
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/hooks/block-instruction-file-edits.sh +26 -35
- package/plugins/lisa/rules/reference/config-resolution.md +1 -1
- package/plugins/lisa/rules/reference/project-learnings.md +28 -3
- package/plugins/lisa-agy/hooks/block-instruction-file-edits.sh +26 -35
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/hooks/block-instruction-file-edits.sh +26 -35
- package/plugins/lisa-copilot/rules/reference/config-resolution.md +1 -1
- package/plugins/lisa-copilot/rules/reference/project-learnings.md +28 -3
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/hooks/block-instruction-file-edits.sh +26 -35
- package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +1 -1
- package/plugins/lisa-cursor/rules/project-learnings-reference.mdc +28 -3
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/src/base/hooks/block-instruction-file-edits.sh +26 -35
- package/plugins/src/base/rules/reference/config-resolution.md +1 -1
- package/plugins/src/base/rules/reference/project-learnings.md +28 -3
|
@@ -20,6 +20,7 @@ export { EnsureTsconfigLocalFilesFallbackMigration } from "./ensure-tsconfig-loc
|
|
|
20
20
|
export { EnsureWikiSourceDeclaredMigration } from "./ensure-wiki-source-declared.js";
|
|
21
21
|
export { EnsureTsconfigLocalIncludesMigration } from "./ensure-tsconfig-local-includes.js";
|
|
22
22
|
export { PruneRetiredClaudeDenyRulesMigration } from "./prune-retired-claude-deny-rules.js";
|
|
23
|
+
export { PreserveVerificationOptInsMigration } from "./preserve-verification-opt-ins.js";
|
|
23
24
|
export { ReconcileClaudeStackPluginsMigration } from "./reconcile-claude-stack-plugins.js";
|
|
24
25
|
export { UntrackCodexMarketplaceMigration } from "./untrack-codex-marketplace.js";
|
|
25
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,yCAAyC,EAAE,MAAM,2CAA2C,CAAC;AACtG,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,6CAA6C,EAAE,MAAM,gDAAgD,CAAC;AAC/G,OAAO,EAAE,qCAAqC,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,uCAAuC,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAE,qCAAqC,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,yCAAyC,EAAE,MAAM,2CAA2C,CAAC;AACtG,OAAO,EAAE,wCAAwC,EAAE,MAAM,yCAAyC,CAAC;AACnG,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,uCAAuC,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAE,yCAAyC,EAAE,MAAM,2CAA2C,CAAC;AACtG,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,oCAAoC,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,oCAAoC,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAElF;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;IAElD;;;OAGG;gBACS,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE;IA8B7C;;;OAGG;IACH,MAAM,IAAI,SAAS,SAAS,EAAE;IAI9B;;;;OAIG;IACG,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/D;;;;OAIG;IACG,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC;CAazE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,iBAAiB,CAE3D"}
|
package/dist/migrations/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import { EnsureTsconfigLocalFilesFallbackMigration } from "./ensure-tsconfig-loc
|
|
|
18
18
|
import { EnsureWikiSourceDeclaredMigration } from "./ensure-wiki-source-declared.js";
|
|
19
19
|
import { EnsureTsconfigLocalIncludesMigration } from "./ensure-tsconfig-local-includes.js";
|
|
20
20
|
import { PruneRetiredClaudeDenyRulesMigration } from "./prune-retired-claude-deny-rules.js";
|
|
21
|
+
import { PreserveVerificationOptInsMigration } from "./preserve-verification-opt-ins.js";
|
|
21
22
|
import { ReconcileClaudeStackPluginsMigration } from "./reconcile-claude-stack-plugins.js";
|
|
22
23
|
import { UntrackCodexMarketplaceMigration } from "./untrack-codex-marketplace.js";
|
|
23
24
|
export { EnsureAuditIgnoreLocalExclusionsMigration } from "./ensure-audit-ignore-local-exclusions.js";
|
|
@@ -40,6 +41,7 @@ export { EnsureTsconfigLocalFilesFallbackMigration } from "./ensure-tsconfig-loc
|
|
|
40
41
|
export { EnsureWikiSourceDeclaredMigration } from "./ensure-wiki-source-declared.js";
|
|
41
42
|
export { EnsureTsconfigLocalIncludesMigration } from "./ensure-tsconfig-local-includes.js";
|
|
42
43
|
export { PruneRetiredClaudeDenyRulesMigration } from "./prune-retired-claude-deny-rules.js";
|
|
44
|
+
export { PreserveVerificationOptInsMigration } from "./preserve-verification-opt-ins.js";
|
|
43
45
|
export { ReconcileClaudeStackPluginsMigration } from "./reconcile-claude-stack-plugins.js";
|
|
44
46
|
export { UntrackCodexMarketplaceMigration } from "./untrack-codex-marketplace.js";
|
|
45
47
|
/**
|
|
@@ -68,6 +70,7 @@ export class MigrationRegistry {
|
|
|
68
70
|
new EnsurePushDefaultSafeMigration(),
|
|
69
71
|
new EnsureQualityCallerScopesMigration(),
|
|
70
72
|
new EnsureSeededGatesMigration(),
|
|
73
|
+
new PreserveVerificationOptInsMigration(),
|
|
71
74
|
new EnsureSonarExcludesLisaHarnessMigration(),
|
|
72
75
|
new EnsureThirdPartyActionPinsMigration(),
|
|
73
76
|
new EnsureWikiSourceDeclaredMigration(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,E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7D,IAAI,yCAAyC,EAAE;SAChD,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,mBAAmB,CAAC,GAAqB;QAC7C,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACxC,IAAI,SAAS,CAAC,gBAAgB,EAAE,CAAC;gBAC/B,MAAM,SAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,GAAqB;QAChC,MAAM,OAAO,GAAsB,EAAE,CAAC;QACtC,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACxC,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC/C,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;gBAC1D,SAAS;YACX,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC1C,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,IAAI,iBAAiB,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Migration, MigrationContext, MigrationResult } from "./migration.interface.js";
|
|
2
|
+
/**
|
|
3
|
+
* Carry an existing workflow opt-in into the declaration that replaced it.
|
|
4
|
+
* No declaration is seeded for an inactive caller, and explicit choices win.
|
|
5
|
+
*
|
|
6
|
+
* Ordinary package installs leave project files unchanged. Explicit applies
|
|
7
|
+
* using the legacy postinstall-safe mode still advance workflow pins while
|
|
8
|
+
* retaining old template content, so this migration also runs in that mode.
|
|
9
|
+
* It preserves an existing choice before the retired input becomes invalid.
|
|
10
|
+
*/
|
|
11
|
+
export declare class PreserveVerificationOptInsMigration implements Migration {
|
|
12
|
+
readonly name = "preserve-verification-opt-ins";
|
|
13
|
+
readonly description = "Preserve existing verification-check opt-ins when updating Lisa workflows";
|
|
14
|
+
private capturedProject;
|
|
15
|
+
private capturedOptIn;
|
|
16
|
+
/**
|
|
17
|
+
* Capture and validate before a managed workflow can lose the old input.
|
|
18
|
+
* @param ctx - Update context.
|
|
19
|
+
*/
|
|
20
|
+
beforeStrategies(ctx: MigrationContext): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve a declaration without overwriting an explicit current choice.
|
|
23
|
+
* @param ctx - Update context.
|
|
24
|
+
* @param edits - Current caller edits.
|
|
25
|
+
* @returns An actionable plan, or null when nothing needs changing.
|
|
26
|
+
*/
|
|
27
|
+
private plan;
|
|
28
|
+
/**
|
|
29
|
+
* Determine whether a former opt-in or a remaining old input needs migration.
|
|
30
|
+
* @param ctx - Update context.
|
|
31
|
+
* @returns Whether applying changes at least one file.
|
|
32
|
+
*/
|
|
33
|
+
applies(ctx: MigrationContext): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Write the equivalent declaration before removing any remaining old input.
|
|
36
|
+
* @param ctx - Update context.
|
|
37
|
+
* @returns The files changed, with dry-run behavior preserved.
|
|
38
|
+
*/
|
|
39
|
+
apply(ctx: MigrationContext): Promise<MigrationResult>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=preserve-verification-opt-ins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preserve-verification-opt-ins.d.ts","sourceRoot":"","sources":["../../src/migrations/preserve-verification-opt-ins.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAqLlC;;;;;;;;GAQG;AACH,qBAAa,mCAAoC,YAAW,SAAS;IACnE,QAAQ,CAAC,IAAI,mCAAmC;IAChD,QAAQ,CAAC,WAAW,+EAC0D;IAC9E,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,aAAa,CAAS;IAE9B;;;OAGG;IACG,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5D;;;;;OAKG;YACW,IAAI;IAqClB;;;;OAIG;IACG,OAAO,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAItD;;;;OAIG;IACG,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;CAoB7D"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { readFile, readdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { isDeepStrictEqual } from "node:util";
|
|
4
|
+
import { isJsonObject } from "../sync/json-path.js";
|
|
5
|
+
import { loadYaml } from "../utils/yaml.js";
|
|
6
|
+
import { writeJson } from "../utils/json-utils.js";
|
|
7
|
+
import { locateJob, locateKey } from "./deploy-outcome-guard-yaml.js";
|
|
8
|
+
const CONFIG = ".lisa.config.json";
|
|
9
|
+
const WORKFLOWS = ".github/workflows";
|
|
10
|
+
const GATE = "coverage-adequacy";
|
|
11
|
+
const MOMENT = "pull-request";
|
|
12
|
+
const LEGACY = "verify_enforced";
|
|
13
|
+
const QUALITY = /^CodySwannGT\/lisa\/\.github\/workflows\/quality\.yml@/u;
|
|
14
|
+
/**
|
|
15
|
+
* Read a file without confusing an unreadable file with a missing one.
|
|
16
|
+
* @param file - File to read.
|
|
17
|
+
* @returns Its contents, or null only when absent.
|
|
18
|
+
*/
|
|
19
|
+
async function readOptional(file) {
|
|
20
|
+
try {
|
|
21
|
+
return await readFile(file, "utf8");
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
if (error.code === "ENOENT")
|
|
25
|
+
return null;
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Require an object before preserving its existing entries.
|
|
31
|
+
* @param value - Configuration value.
|
|
32
|
+
* @param name - Safe configuration path for the error message.
|
|
33
|
+
* @returns The existing object.
|
|
34
|
+
*/
|
|
35
|
+
function object(value, name) {
|
|
36
|
+
if (!isJsonObject(value))
|
|
37
|
+
throw new Error(`Cannot preserve verification opt-in: ${name} must be an object.`);
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Remove one literal input while preserving the rest of the YAML byte-for-byte.
|
|
42
|
+
* @param source - Original workflow.
|
|
43
|
+
* @param id - Parsed job identifier.
|
|
44
|
+
* @param emptyWith - Whether removing this input empties the with map.
|
|
45
|
+
* @returns Edited workflow, or throws before writing an ambiguous shape.
|
|
46
|
+
*/
|
|
47
|
+
function removeInput(source, id, emptyWith) {
|
|
48
|
+
const lines = source.split("\n");
|
|
49
|
+
const block = /^[A-Za-z_][A-Za-z0-9_-]*$/u.test(id)
|
|
50
|
+
? locateJob(lines, id)
|
|
51
|
+
: null;
|
|
52
|
+
const span = block ? locateKey(lines, block, "with") : null;
|
|
53
|
+
const matches = span
|
|
54
|
+
? lines.flatMap((line, index) => index > span.start &&
|
|
55
|
+
index < span.end &&
|
|
56
|
+
/^\s+verify_enforced:\s*true\s*(?:#.*)?\r?$/iu.test(line)
|
|
57
|
+
? [index]
|
|
58
|
+
: [])
|
|
59
|
+
: [];
|
|
60
|
+
if (!span || matches.length !== 1)
|
|
61
|
+
throw new Error("Cannot safely migrate the verification input in this YAML layout; the caller was left unchanged.");
|
|
62
|
+
return lines
|
|
63
|
+
.filter((_, index) => index !== matches[0] && !(emptyWith && index === span.start))
|
|
64
|
+
.join("\n");
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Recognize only actual opt-ins to Lisa's standard PR workflow.
|
|
68
|
+
* @param source - Workflow text.
|
|
69
|
+
* @returns The edited text, or null when no supported input is present.
|
|
70
|
+
*/
|
|
71
|
+
function migrateCaller(source) {
|
|
72
|
+
if (!source.includes(LEGACY))
|
|
73
|
+
return null;
|
|
74
|
+
const document = object(loadYaml(source), "workflow");
|
|
75
|
+
if (!isJsonObject(document.jobs))
|
|
76
|
+
return null;
|
|
77
|
+
const edited = Object.entries(document.jobs).reduce((state, [id, value]) => migrateJob(state, id, value), { source, jobs: document.jobs });
|
|
78
|
+
if (edited.source === source)
|
|
79
|
+
return null;
|
|
80
|
+
if (!isDeepStrictEqual(loadYaml(edited.source), {
|
|
81
|
+
...document,
|
|
82
|
+
jobs: edited.jobs,
|
|
83
|
+
}))
|
|
84
|
+
throw new Error("Verification input migration would change unrelated workflow data; the caller was left unchanged.");
|
|
85
|
+
return edited.source;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Preserve one opted-in job while retaining the other workflow data.
|
|
89
|
+
* @param state - Current workflow text and job mapping.
|
|
90
|
+
* @param state.source - Current workflow text.
|
|
91
|
+
* @param state.jobs - Current job mapping.
|
|
92
|
+
* @param id - Job identifier.
|
|
93
|
+
* @param value - Parsed job.
|
|
94
|
+
* @returns Updated workflow state.
|
|
95
|
+
*/
|
|
96
|
+
function migrateJob(state, id, value) {
|
|
97
|
+
if (!isJsonObject(value) ||
|
|
98
|
+
typeof value.uses !== "string" ||
|
|
99
|
+
!QUALITY.test(value.uses) ||
|
|
100
|
+
!isJsonObject(value.with) ||
|
|
101
|
+
value.with[LEGACY] !== true)
|
|
102
|
+
return state;
|
|
103
|
+
const input = value.with;
|
|
104
|
+
// The measured legacy callers use the project root and PR moment. Do not
|
|
105
|
+
// guess which settings file a dynamic or differently scoped caller reads.
|
|
106
|
+
if ((input.working_directory !== undefined &&
|
|
107
|
+
input.working_directory !== "." &&
|
|
108
|
+
input.working_directory !== "") ||
|
|
109
|
+
(input.moment !== undefined && input.moment !== MOMENT)) {
|
|
110
|
+
throw new Error("Cannot migrate this verification opt-in automatically: preserve or add the equivalent coverage-adequacy declaration in the caller's working directory and moment, then remove verify_enforced before updating Lisa.");
|
|
111
|
+
}
|
|
112
|
+
const { verify_enforced: _legacy, ...remaining } = input;
|
|
113
|
+
const { with: _inputs, ...job } = value;
|
|
114
|
+
const emptyWith = Object.keys(remaining).length === 0;
|
|
115
|
+
return {
|
|
116
|
+
jobs: {
|
|
117
|
+
...state.jobs,
|
|
118
|
+
[id]: emptyWith ? job : { ...job, with: remaining },
|
|
119
|
+
},
|
|
120
|
+
source: removeInput(state.source, id, emptyWith),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Read only workflow files, collecting literal opt-ins and validating each edit.
|
|
125
|
+
* @param projectDir - Project being updated.
|
|
126
|
+
* @returns Safe caller edits.
|
|
127
|
+
*/
|
|
128
|
+
async function callerEdits(projectDir) {
|
|
129
|
+
const files = await readdir(path.join(projectDir, WORKFLOWS), {
|
|
130
|
+
withFileTypes: true,
|
|
131
|
+
}).catch((error) => {
|
|
132
|
+
if (error.code === "ENOENT")
|
|
133
|
+
return [];
|
|
134
|
+
throw error;
|
|
135
|
+
});
|
|
136
|
+
const edits = await Promise.all(files
|
|
137
|
+
.filter(file => file.isFile() && /\.ya?ml$/u.test(file.name))
|
|
138
|
+
.map(async (file) => {
|
|
139
|
+
const relative = path.join(WORKFLOWS, file.name);
|
|
140
|
+
const source = await readFile(path.join(projectDir, relative), "utf8");
|
|
141
|
+
const migrated = migrateCaller(source);
|
|
142
|
+
return migrated === null ? null : { relative, source: migrated };
|
|
143
|
+
}));
|
|
144
|
+
return edits.filter((edit) => edit !== null);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Carry an existing workflow opt-in into the declaration that replaced it.
|
|
148
|
+
* No declaration is seeded for an inactive caller, and explicit choices win.
|
|
149
|
+
*
|
|
150
|
+
* Ordinary package installs leave project files unchanged. Explicit applies
|
|
151
|
+
* using the legacy postinstall-safe mode still advance workflow pins while
|
|
152
|
+
* retaining old template content, so this migration also runs in that mode.
|
|
153
|
+
* It preserves an existing choice before the retired input becomes invalid.
|
|
154
|
+
*/
|
|
155
|
+
export class PreserveVerificationOptInsMigration {
|
|
156
|
+
name = "preserve-verification-opt-ins";
|
|
157
|
+
description = "Preserve existing verification-check opt-ins when updating Lisa workflows";
|
|
158
|
+
capturedProject = null;
|
|
159
|
+
capturedOptIn = false;
|
|
160
|
+
/**
|
|
161
|
+
* Capture and validate before a managed workflow can lose the old input.
|
|
162
|
+
* @param ctx - Update context.
|
|
163
|
+
*/
|
|
164
|
+
async beforeStrategies(ctx) {
|
|
165
|
+
const edits = await callerEdits(ctx.projectDir);
|
|
166
|
+
this.capturedProject = ctx.projectDir;
|
|
167
|
+
this.capturedOptIn = edits.length > 0;
|
|
168
|
+
if (this.capturedOptIn)
|
|
169
|
+
await this.plan(ctx, edits);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Resolve a declaration without overwriting an explicit current choice.
|
|
173
|
+
* @param ctx - Update context.
|
|
174
|
+
* @param edits - Current caller edits.
|
|
175
|
+
* @returns An actionable plan, or null when nothing needs changing.
|
|
176
|
+
*/
|
|
177
|
+
async plan(ctx, edits) {
|
|
178
|
+
if (edits.length === 0 &&
|
|
179
|
+
!(this.capturedProject === ctx.projectDir && this.capturedOptIn))
|
|
180
|
+
return null;
|
|
181
|
+
const text = await readOptional(path.join(ctx.projectDir, CONFIG));
|
|
182
|
+
const config = text === null ? {} : object(JSON.parse(text), CONFIG);
|
|
183
|
+
const gates = Object.hasOwn(config, "gates")
|
|
184
|
+
? object(config.gates, "gates")
|
|
185
|
+
: {};
|
|
186
|
+
const coverage = Object.hasOwn(gates, GATE)
|
|
187
|
+
? object(gates[GATE], `gates.${GATE}`)
|
|
188
|
+
: {};
|
|
189
|
+
const seed = !Object.hasOwn(coverage, MOMENT);
|
|
190
|
+
if (!seed && edits.length === 0)
|
|
191
|
+
return null;
|
|
192
|
+
return {
|
|
193
|
+
edits,
|
|
194
|
+
seed,
|
|
195
|
+
config: seed
|
|
196
|
+
? {
|
|
197
|
+
...config,
|
|
198
|
+
gates: {
|
|
199
|
+
...gates,
|
|
200
|
+
[GATE]: {
|
|
201
|
+
...coverage,
|
|
202
|
+
[MOMENT]: { level: "required", run: "check:verification" },
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
}
|
|
206
|
+
: config,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Determine whether a former opt-in or a remaining old input needs migration.
|
|
211
|
+
* @param ctx - Update context.
|
|
212
|
+
* @returns Whether applying changes at least one file.
|
|
213
|
+
*/
|
|
214
|
+
async applies(ctx) {
|
|
215
|
+
return (await this.plan(ctx, await callerEdits(ctx.projectDir))) !== null;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Write the equivalent declaration before removing any remaining old input.
|
|
219
|
+
* @param ctx - Update context.
|
|
220
|
+
* @returns The files changed, with dry-run behavior preserved.
|
|
221
|
+
*/
|
|
222
|
+
async apply(ctx) {
|
|
223
|
+
const plan = await this.plan(ctx, await callerEdits(ctx.projectDir));
|
|
224
|
+
if (plan === null)
|
|
225
|
+
return { name: this.name, action: "noop" };
|
|
226
|
+
const changedFiles = [
|
|
227
|
+
...(plan.seed ? [CONFIG] : []),
|
|
228
|
+
...plan.edits.map(edit => edit.relative),
|
|
229
|
+
];
|
|
230
|
+
const message = "Preserved the project's verification-check choice and removed its retired workflow input.";
|
|
231
|
+
if (ctx.dryRun)
|
|
232
|
+
ctx.logger.dry(message);
|
|
233
|
+
else {
|
|
234
|
+
if (plan.seed)
|
|
235
|
+
await writeJson(path.join(ctx.projectDir, CONFIG), plan.config);
|
|
236
|
+
for (const edit of plan.edits)
|
|
237
|
+
await writeFile(path.join(ctx.projectDir, edit.relative), edit.source);
|
|
238
|
+
this.capturedOptIn = false;
|
|
239
|
+
ctx.logger.success(message);
|
|
240
|
+
}
|
|
241
|
+
return { name: this.name, action: "applied", changedFiles, message };
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=preserve-verification-opt-ins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preserve-verification-opt-ins.js","sourceRoot":"","sources":["../../src/migrations/preserve-verification-opt-ins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAmB,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAOtE,MAAM,MAAM,GAAG,mBAAmB,CAAC;AACnC,MAAM,SAAS,GAAG,mBAAmB,CAAC;AACtC,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,MAAM,GAAG,cAAc,CAAC;AAC9B,MAAM,MAAM,GAAG,iBAAiB,CAAC;AACjC,MAAM,OAAO,GAAG,yDAAyD,CAAC;AAe1E;;;;GAIG;AACH,KAAK,UAAU,YAAY,CAAC,IAAY;IACtC,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QACpE,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,MAAM,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,CAAC,KAAK;gBAC3B,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACzE,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;YAC3B,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* session for the project. Agents appending their own findings is how they grow
|
|
8
8
|
* into hundreds of lines of stale, ticket-specific trivia.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* path comes
|
|
10
|
+
* Adapter for Lisa's hook `block-instruction-file-edits.sh`. This adapter
|
|
11
|
+
* handles `edit` / `write`; shell screening belongs to the shell dispatcher
|
|
12
|
+
* where installed. The file path comes from `output.args.filePath`. Throwing in
|
|
13
13
|
* `tool.execute.before` cancels the tool call and surfaces the message to the
|
|
14
14
|
* agent.
|
|
15
15
|
*
|
|
@@ -35,10 +35,11 @@ const LisaBlockInstructionFileEdits = async () => {
|
|
|
35
35
|
const filePath = String(output.args?.filePath ?? "");
|
|
36
36
|
if (!filePath) return;
|
|
37
37
|
if (/(^|\/)(node_modules|dist)\//.test(filePath)) return;
|
|
38
|
-
//
|
|
38
|
+
// Existing operator-configured override; not proof of conversation approval.
|
|
39
39
|
if (process.env["LISA_ALLOW_INSTRUCTION_FILE_WRITE"]) return;
|
|
40
|
-
//
|
|
41
|
-
//
|
|
40
|
+
// Existing parity gap: this adapter accepts a content marker; the shell
|
|
41
|
+
// guard requires bounded old/new replacement pairs. Do not describe this
|
|
42
|
+
// weaker exemption as authorization or proof that an edit cannot grow.
|
|
42
43
|
if (String(output.args?.content ?? "").includes("<!-- LISA_")) return;
|
|
43
44
|
const base = (filePath.split("/").pop() ?? "").toLowerCase();
|
|
44
45
|
if (!INSTRUCTION_FILES.has(base)) return;
|
|
@@ -46,25 +47,27 @@ const LisaBlockInstructionFileEdits = async () => {
|
|
|
46
47
|
[
|
|
47
48
|
`block-instruction-file-edits: refusing to write ${filePath}.`,
|
|
48
49
|
"",
|
|
49
|
-
"WHY: this
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"human-curated on purpose.",
|
|
50
|
+
"WHY: this session-instruction file is loaded into future agent sessions.",
|
|
51
|
+
"Appending incidental findings makes every later session carry those notes.",
|
|
52
|
+
"This adapter cannot read or authenticate conversation approval.",
|
|
53
53
|
"",
|
|
54
|
-
"
|
|
54
|
+
"If an operator already requested a standing-rule edit, that authorization",
|
|
55
|
+
"is enough for the requested change. Use the relevant topic file in",
|
|
56
|
+
".agents/rules/ when no other destination was specified. All six agents",
|
|
57
|
+
"read it through the existing AGENTS.md pointer. Edit it directly; do not",
|
|
58
|
+
"require learning capture, another ticket, or repeated approval.",
|
|
55
59
|
"",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"3. It is true beyond this project? Propose it upstream via",
|
|
62
|
-
" /lisa:cross-pollinate, or open an issue on CodySwannGT/lisa.",
|
|
63
|
-
"4. Otherwise it is background, not a standing instruction — write it",
|
|
64
|
-
" into the project documentation (wiki/ or docs/).",
|
|
60
|
+
"If the operator explicitly named this guarded file, preserve that target",
|
|
61
|
+
"and use the runtime's authorized edit path, or report this restriction.",
|
|
62
|
+
"Do not silently move the edit, switch tools to evade this refusal, or",
|
|
63
|
+
"set an override yourself. The existing operator-configured",
|
|
64
|
+
"LISA_ALLOW_INSTRUCTION_FILE_WRITE=1 escape hatch is not proof of consent.",
|
|
65
65
|
"",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
66
|
+
"For an agent's own finding, first decide whether it is worth maintaining.",
|
|
67
|
+
"Decline one-off trivia and unnecessary rules. Durable project knowledge",
|
|
68
|
+
"can use /lisa:persist-learning; procedures belong with their SKILL.md;",
|
|
69
|
+
"background belongs in existing documentation. Use /lisa:cross-pollinate",
|
|
70
|
+
"only for a material, reusable upstream improvement.",
|
|
68
71
|
].join("\n")
|
|
69
72
|
);
|
|
70
73
|
},
|
package/package.json
CHANGED
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
"zod-validation-error": "^4.0.0"
|
|
188
188
|
},
|
|
189
189
|
"name": "@codyswann/lisa",
|
|
190
|
-
"version": "4.60.
|
|
190
|
+
"version": "4.60.10",
|
|
191
191
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
192
192
|
"main": "dist/index.js",
|
|
193
193
|
"exports": {
|
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
"test": "tests"
|
|
337
337
|
},
|
|
338
338
|
"types": "./dist/index.d.ts",
|
|
339
|
-
"lisaReleaseCommit": "
|
|
340
|
-
"gitHead": "
|
|
341
|
-
"lisaReleaseTag": "v4.60.
|
|
339
|
+
"lisaReleaseCommit": "c6462f88735bb3439346baa2678a76a3f85f8b85",
|
|
340
|
+
"gitHead": "c6462f88735bb3439346baa2678a76a3f85f8b85",
|
|
341
|
+
"lisaReleaseTag": "v4.60.10"
|
|
342
342
|
}
|
|
@@ -24,11 +24,9 @@
|
|
|
24
24
|
# Reads (`cat AGENTS.md`, `rg pattern AGENTS.md`) never fire.
|
|
25
25
|
#
|
|
26
26
|
# Exemptions (allowed):
|
|
27
|
-
# - `LISA_ALLOW_INSTRUCTION_FILE_WRITE` set
|
|
28
|
-
#
|
|
29
|
-
# -
|
|
30
|
-
# (the agy project-learnings bridge, cross-pollinate's rule section) replace
|
|
31
|
-
# in place on re-run and cannot grow the file;
|
|
27
|
+
# - `LISA_ALLOW_INSTRUCTION_FILE_WRITE` set in the operator's runtime config.
|
|
28
|
+
# This cooperative override does not authenticate conversation approval;
|
|
29
|
+
# - Edit/MultiEdit replacing only bounded `<!-- LISA_` regions on both sides;
|
|
32
30
|
# - paths under `node_modules/` or `dist/` — vendored copies, not the host's.
|
|
33
31
|
set -euo pipefail
|
|
34
32
|
|
|
@@ -58,8 +56,8 @@ fi
|
|
|
58
56
|
|
|
59
57
|
command -v jq >/dev/null 2>&1 || exit 0
|
|
60
58
|
|
|
61
|
-
#
|
|
62
|
-
#
|
|
59
|
+
# Existing operator-configured override. This hook sees tool payloads, not the
|
|
60
|
+
# conversation; the environment variable is not proof of who approved an edit.
|
|
63
61
|
if [ -n "${LISA_ALLOW_INSTRUCTION_FILE_WRITE:-}" ]; then
|
|
64
62
|
exit 0
|
|
65
63
|
fi
|
|
@@ -129,34 +127,27 @@ refuse() {
|
|
|
129
127
|
cat >&2 <<EOF
|
|
130
128
|
BLOCKED: refusing to write \`$target\`.
|
|
131
129
|
|
|
132
|
-
WHY: this
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
4. None of the above — it is background someone may want to look up, not a
|
|
155
|
-
standing instruction. Write it into the project documentation (\`wiki/\` or
|
|
156
|
-
\`docs/\`).
|
|
157
|
-
|
|
158
|
-
If a human explicitly asked for this edit, they can re-run with
|
|
159
|
-
\`LISA_ALLOW_INSTRUCTION_FILE_WRITE=1\` set, which bypasses this guard.
|
|
130
|
+
WHY: this session-instruction file is loaded into future agent sessions.
|
|
131
|
+
Appending incidental findings makes every later session carry those notes.
|
|
132
|
+
This hook checks write patterns; it cannot read or authenticate conversation approval.
|
|
133
|
+
|
|
134
|
+
If an operator already requested a standing-rule edit, that authorization is
|
|
135
|
+
enough for the requested change. Use the relevant topic file in \`.agents/rules/\`
|
|
136
|
+
when no other destination was specified. All six supported agents read that
|
|
137
|
+
directory through the existing \`AGENTS.md\` pointer. Edit it directly; do not
|
|
138
|
+
require learning capture, another ticket, or repeated approval for the same ruling.
|
|
139
|
+
|
|
140
|
+
If the operator explicitly named this guarded file, preserve that target and
|
|
141
|
+
use the runtime's authorized edit path, or report this remaining restriction.
|
|
142
|
+
Do not silently move the edit, switch tools to evade this refusal, or set an
|
|
143
|
+
override yourself. The existing operator-configured
|
|
144
|
+
\`LISA_ALLOW_INSTRUCTION_FILE_WRITE=1\` escape hatch is not proof of consent.
|
|
145
|
+
|
|
146
|
+
For an agent's own finding, first decide whether it is worth maintaining.
|
|
147
|
+
Decline one-off trivia and unnecessary rules. Durable project knowledge can
|
|
148
|
+
use \`/lisa:persist-learning\`; procedural knowledge belongs with its SKILL.md;
|
|
149
|
+
background belongs in existing project documentation. Use
|
|
150
|
+
\`/lisa:cross-pollinate\` only for a material, reusable upstream improvement.
|
|
160
151
|
EOF
|
|
161
152
|
exit 2
|
|
162
153
|
}
|
|
@@ -286,7 +286,7 @@ fi
|
|
|
286
286
|
Host-authored operating rules live in `.agents/rules/` — **fixed, not configurable**. One directory, every agent.
|
|
287
287
|
|
|
288
288
|
- **Not a native auto-load tree.** `.claude/rules`, `.cursor/rules`, and `.github/instructions` are; `.agents/rules` deliberately is not. Every agent reaches it through the single Lisa-managed pointer block in `AGENTS.md` (Claude via the `@AGENTS.md` import in `CLAUDE.md`), so no agent loads host rules twice.
|
|
289
|
-
- **Host-owned.** Lisa never
|
|
289
|
+
- **Host-owned.** Lisa's installer never overwrites host rule bodies. Agents may make specific operator-requested edits directly, without recapturing the approved decision as a learning or promotion ticket; see **Operator-directed standing rules** in `project-learnings.md`. Lisa's own rules arrive through its plugins.
|
|
290
290
|
- **Not the learnings ledger.** `.agents/rules` is reserved in the auto-loaded-tree blocklist, so a `learnings.file` override can never resolve inside it.
|
|
291
291
|
- **Transition.** A project that still has the retired `.claude/rules/PROJECT_RULES.md` keeps it, untouched and authoritative. The pointer block names it so agents whose runtime does not auto-load `.claude/rules/` still find it. Moving that content is a human-gated decision, never an automated rewrite.
|
|
292
292
|
|
|
@@ -81,10 +81,35 @@ collide.
|
|
|
81
81
|
- The **build-intake flows** advance `last_confirmed` at claim time
|
|
82
82
|
(`confirmLearningEntry`, below).
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
Automated promotion of a captured learning to a higher rung (skill, eager rule,
|
|
85
|
+
executable control, upstream ticket) is the gardener's job, gated by a human
|
|
86
86
|
flipping a tracker ticket to `status:ready`.
|
|
87
87
|
|
|
88
|
+
## Operator-directed standing rules
|
|
89
|
+
|
|
90
|
+
An operator's instruction to add, revise, or remove a standing rule is already
|
|
91
|
+
authorization for that specific edit. It is not a new machine-captured learning.
|
|
92
|
+
Make the requested change directly, preserving unrelated content; do not require
|
|
93
|
+
learning capture, a promotion ticket, or repeated approval for the same decision.
|
|
94
|
+
"Human-authored" describes who controls the rule, not who types the approved edit.
|
|
95
|
+
|
|
96
|
+
Use the existing topic file under `.agents/rules/`, or create a short one there,
|
|
97
|
+
when the operator has not specified another destination. The `AGENTS.md` host-rules
|
|
98
|
+
pointer reaches Claude Code, Codex, Cursor, OpenCode, Antigravity, and Copilot.
|
|
99
|
+
These shared rules are not a Claude-only surface, and they do not need to be
|
|
100
|
+
copied into every agent's startup file.
|
|
101
|
+
|
|
102
|
+
If the operator explicitly named a guarded startup file, do not substitute a
|
|
103
|
+
different destination or switch tools to evade a refusal. Use the runtime's
|
|
104
|
+
authorized edit path, or report the specific remaining runtime restriction.
|
|
105
|
+
The existing instruction-file override is an operator-configured escape hatch,
|
|
106
|
+
not proof of human approval; agents must not set it to work around a refusal.
|
|
107
|
+
No new approval token is needed for ordinary authorized edits to shared host rules.
|
|
108
|
+
|
|
109
|
+
This does not authorize agents to promote their own incidental findings. Decline
|
|
110
|
+
one-off notes and unnecessary rules; use the existing learning flow only for
|
|
111
|
+
durable knowledge worth maintaining.
|
|
112
|
+
|
|
88
113
|
## Claim-time confirmation (`last_confirmed`)
|
|
89
114
|
|
|
90
115
|
`last_confirmed` is advanced at claim time by the build-intake flows (step
|
|
@@ -111,7 +136,7 @@ warning, apply no entry, and do not block unrelated work.
|
|
|
111
136
|
Precedence:
|
|
112
137
|
|
|
113
138
|
1. System, developer, user, and repo instructions still outrank learnings.
|
|
114
|
-
2. Committed host rules (`.agents/rules/`) remain durable
|
|
139
|
+
2. Committed host rules (`.agents/rules/`) remain durable, operator-controlled
|
|
115
140
|
guidance.
|
|
116
141
|
3. Project learnings add recent operational knowledge, but never rewrite or
|
|
117
142
|
append to host rules.
|