@draig/lexis-two 1.0.2 → 1.0.4
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/package.json +7 -1
- package/.agents/plugins/marketplace.json +0 -21
- package/.claude-plugin/marketplace.json +0 -29
- package/.claude-plugin/plugin.json +0 -9
- package/.clinerules/lexis-two.md +0 -163
- package/.codex-plugin/plugin.json +0 -31
- package/.cursor/rules/lexis-two.mdc +0 -169
- package/.env.example +0 -8
- package/.github/FUNDING.yml +0 -1
- package/.github/copilot-instructions.md +0 -47
- package/.github/plugin/marketplace.json +0 -20
- package/.github/plugin/plugin.json +0 -16
- package/.github/workflows/deploy-site.yml +0 -53
- package/.github/workflows/test.yml +0 -29
- package/.kiro/steering/lexis-two.md +0 -167
- package/.nojekyll +0 -0
- package/.windsurf/rules/lexis-two.md +0 -163
- package/AGENTS.md +0 -163
- package/AUDIT.md +0 -74
- package/CNAME +0 -1
- package/SPECXIS.md +0 -576
- package/assets/benchmark-3model.svg +0 -21
- package/assets/lexis-two-complete.webp +0 -0
- package/assets/lexis-two-nobg.png +0 -0
- package/assets/logo.png +0 -0
- package/assets/social-preview.png +0 -0
- package/benchmarks/README.md +0 -114
- package/benchmarks/arms/baseline.js +0 -2
- package/benchmarks/arms/caveman-SKILL.md +0 -67
- package/benchmarks/arms/caveman.js +0 -8
- package/benchmarks/arms/lexis-two.js +0 -10
- package/benchmarks/arms/ponytail.js +0 -6
- package/benchmarks/behavior.js +0 -58
- package/benchmarks/behavior.yaml +0 -40
- package/benchmarks/benchmark-local.py +0 -156
- package/benchmarks/benchmark-opencode-go.js +0 -294
- package/benchmarks/correctness.js +0 -294
- package/benchmarks/lib/aggregate-opencode-go.js +0 -103
- package/benchmarks/lib/load-env.js +0 -31
- package/benchmarks/lib/opencode-go-client.js +0 -151
- package/benchmarks/loc.js +0 -13
- package/benchmarks/opencode-go-models.json +0 -31
- package/benchmarks/promptfooconfig.yaml +0 -41
- package/benchmarks/prompts.json +0 -15
- package/benchmarks/render-opencode-go-report.js +0 -28
- package/benchmarks/results/2026-06-15-llama3.2-local.md +0 -76
- package/benchmarks/results/2026-06-16-opencode-go.md +0 -56
- package/benchmarks/results/opencode-go-2026-06-16-report.html +0 -226
- package/benchmarks/results/opencode-go-2026-06-16.json +0 -1339
- package/commands/lexis-two-audit.toml +0 -3
- package/commands/lexis-two-debt.toml +0 -3
- package/commands/lexis-two-help.toml +0 -3
- package/commands/lexis-two-plan.toml +0 -3
- package/commands/lexis-two-review.toml +0 -3
- package/commands/lexis-two-security.toml +0 -3
- package/commands/lexis-two.toml +0 -3
- package/docs/assets/lexis-two-nobg.png +0 -0
- package/docs/assets/logo.png +0 -0
- package/docs/assets/logo.svg +0 -4
- package/docs/portability.md +0 -147
- package/docs/site.md +0 -52
- package/examples/api-endpoint.md +0 -68
- package/examples/caching.md +0 -74
- package/examples/date-picker.md +0 -48
- package/examples/email-validation.md +0 -51
- package/examples/sorting.md +0 -42
- package/gemini-extension.json +0 -7
- package/opencode.json +0 -4
- package/pi-extension/index.js +0 -161
- package/pi-extension/package.json +0 -8
- package/pi-extension/test/extension.test.js +0 -89
- package/pi-extension/test/helpers.test.js +0 -35
- package/scripts/check-rule-copies.js +0 -82
- package/site/astro.config.mjs +0 -18
- package/site/package-lock.json +0 -4913
- package/site/package.json +0 -14
- package/site/public/CNAME +0 -1
- package/site/public/assets/lexis-two-nobg.png +0 -0
- package/site/public/assets/logo.png +0 -0
- package/site/public/assets/logo.svg +0 -4
- package/site/public/robots.txt +0 -4
- package/site/src/components/Adapt.astro +0 -33
- package/site/src/components/Benchmarks.astro +0 -232
- package/site/src/components/Commands.astro +0 -33
- package/site/src/components/Ecosystem.astro +0 -30
- package/site/src/components/Example.astro +0 -77
- package/site/src/components/Footer.astro +0 -28
- package/site/src/components/Header.astro +0 -87
- package/site/src/components/Hero.astro +0 -58
- package/site/src/components/Home.astro +0 -46
- package/site/src/components/Hosts.astro +0 -62
- package/site/src/components/Install.astro +0 -139
- package/site/src/components/LanguageSwitcher.astro +0 -82
- package/site/src/components/Philosophy.astro +0 -23
- package/site/src/components/Stacks.astro +0 -33
- package/site/src/components/Suggested.astro +0 -39
- package/site/src/data/opencode-go-benchmark.json +0 -230
- package/site/src/i18n/en.ts +0 -155
- package/site/src/i18n/es.ts +0 -158
- package/site/src/i18n/index.ts +0 -14
- package/site/src/layouts/Layout.astro +0 -114
- package/site/src/pages/benchmarks.astro +0 -4
- package/site/src/pages/es/benchmarks.astro +0 -4
- package/site/src/pages/es/index.astro +0 -10
- package/site/src/pages/index.astro +0 -10
- package/site/src/styles/global.css +0 -780
- package/site/tsconfig.json +0 -3
- package/tests/behavior.test.js +0 -80
- package/tests/commands.test.js +0 -40
- package/tests/copilot-plugin.test.js +0 -33
- package/tests/correctness.test.js +0 -191
- package/tests/gemini-extension.test.js +0 -78
- package/tests/hooks-windows.test.js +0 -48
- package/tests/hooks.test.js +0 -177
- package/tests/opencode-plugin.test.js +0 -64
package/pi-extension/index.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
const require = createRequire(import.meta.url);
|
|
4
|
-
const {
|
|
5
|
-
DEFAULT_MODE,
|
|
6
|
-
getDefaultMode,
|
|
7
|
-
normalizeMode,
|
|
8
|
-
normalizeConfigMode,
|
|
9
|
-
normalizePersistedMode,
|
|
10
|
-
writeDefaultMode,
|
|
11
|
-
} = require("../hooks/lexis-two-config.js");
|
|
12
|
-
const { getLexisInstructions, filterSkillBodyForMode } = require("../hooks/lexis-two-instructions.js");
|
|
13
|
-
|
|
14
|
-
export { filterSkillBodyForMode };
|
|
15
|
-
export const readDefaultMode = getDefaultMode;
|
|
16
|
-
|
|
17
|
-
export function resolveSessionMode(entries, fallbackMode = DEFAULT_MODE) {
|
|
18
|
-
const fallback = normalizePersistedMode(fallbackMode) || DEFAULT_MODE;
|
|
19
|
-
if (!Array.isArray(entries)) return fallback;
|
|
20
|
-
|
|
21
|
-
for (let i = entries.length - 1; i >= 0; i -= 1) {
|
|
22
|
-
const entry = entries[i];
|
|
23
|
-
if (entry?.type !== "custom" || entry?.customType !== "lexis-two-mode") continue;
|
|
24
|
-
|
|
25
|
-
const mode = normalizePersistedMode(entry?.data?.mode);
|
|
26
|
-
if (mode) return mode;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return fallback;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function parseLexisCommand(text, defaultMode = DEFAULT_MODE) {
|
|
33
|
-
const fallback = normalizePersistedMode(defaultMode) || DEFAULT_MODE;
|
|
34
|
-
const normalizedText = String(text || "").trim().toLowerCase();
|
|
35
|
-
|
|
36
|
-
if (!normalizedText) {
|
|
37
|
-
return { type: "set-mode", mode: fallback === "off" ? "full" : fallback };
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const [primary, secondary] = normalizedText.split(/\s+/);
|
|
41
|
-
|
|
42
|
-
if (primary === "status") return { type: "status" };
|
|
43
|
-
|
|
44
|
-
if (primary === "default") {
|
|
45
|
-
const mode = normalizeConfigMode(secondary);
|
|
46
|
-
return mode ? { type: "set-default", mode } : { type: "invalid", reason: "invalid-default-mode" };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const mode = normalizeMode(primary);
|
|
50
|
-
return mode ? { type: "set-mode", mode } : { type: "invalid", reason: "invalid-mode", mode: primary };
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { writeDefaultMode };
|
|
54
|
-
|
|
55
|
-
export default function lexisExtension(pi) {
|
|
56
|
-
let currentMode = DEFAULT_MODE;
|
|
57
|
-
let configuredDefaultMode = getDefaultMode();
|
|
58
|
-
|
|
59
|
-
const setMode = (mode, ctx) => {
|
|
60
|
-
const normalized = normalizePersistedMode(mode);
|
|
61
|
-
if (!normalized) return;
|
|
62
|
-
|
|
63
|
-
currentMode = normalized;
|
|
64
|
-
pi.appendEntry("lexis-two-mode", { mode: normalized });
|
|
65
|
-
ctx?.ui?.notify?.(`Lexis-Two mode set to ${normalized}.`, "info");
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const sendAlias = (skillName, args, ctx) => {
|
|
69
|
-
const normalized = String(args || "").trim();
|
|
70
|
-
const message = normalized ? `${skillName} ${normalized}` : skillName;
|
|
71
|
-
|
|
72
|
-
if (ctx?.isIdle?.() === false) {
|
|
73
|
-
pi.sendUserMessage(message, { deliverAs: "followUp" });
|
|
74
|
-
ctx?.ui?.notify?.(`${skillName} queued as follow-up.`, "info");
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
pi.sendUserMessage(message);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
pi.registerCommand("lexis-two", {
|
|
82
|
-
description: "Set or report Lexis-Two mode",
|
|
83
|
-
handler: async (args, ctx) => {
|
|
84
|
-
const parsed = parseLexisCommand(args, configuredDefaultMode);
|
|
85
|
-
|
|
86
|
-
if (parsed.type === "status") {
|
|
87
|
-
ctx?.ui?.notify?.(`Lexis-Two: current ${currentMode} • default ${configuredDefaultMode}`, "info");
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (parsed.type === "set-default") {
|
|
92
|
-
const written = writeDefaultMode(parsed.mode);
|
|
93
|
-
if (written) {
|
|
94
|
-
configuredDefaultMode = getDefaultMode();
|
|
95
|
-
const message = configuredDefaultMode === written
|
|
96
|
-
? `Default Lexis-Two mode set to ${written}.`
|
|
97
|
-
: `Saved default ${written}, but env override keeps default at ${configuredDefaultMode}.`;
|
|
98
|
-
ctx?.ui?.notify?.(message, "info");
|
|
99
|
-
}
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (parsed.type === "set-mode") {
|
|
104
|
-
setMode(parsed.mode, ctx);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
ctx?.ui?.notify?.("Unknown or unsupported /lexis-two mode.", "warning");
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
pi.registerCommand("lexis-two-review", {
|
|
113
|
-
description: "Run /skill:lexis-two-review",
|
|
114
|
-
handler: (_args, ctx) => sendAlias("/skill:lexis-two-review", "", ctx),
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
pi.registerCommand("lexis-two-audit", {
|
|
118
|
-
description: "Run /skill:lexis-two-audit",
|
|
119
|
-
handler: (_args, ctx) => sendAlias("/skill:lexis-two-audit", "", ctx),
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
pi.registerCommand("lexis-two-debt", {
|
|
123
|
-
description: "Run /skill:lexis-two-debt",
|
|
124
|
-
handler: (_args, ctx) => sendAlias("/skill:lexis-two-debt", "", ctx),
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
pi.registerCommand("lexis-two-plan", {
|
|
128
|
-
description: "Run /skill:lexis-two-plan",
|
|
129
|
-
handler: (_args, ctx) => sendAlias("/skill:lexis-two-plan", "", ctx),
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
pi.registerCommand("lexis-two-security", {
|
|
133
|
-
description: "Run /skill:lexis-two-security",
|
|
134
|
-
handler: (_args, ctx) => sendAlias("/skill:lexis-two-security", "", ctx),
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
pi.registerCommand("lexis-two-help", {
|
|
138
|
-
description: "Run /skill:lexis-two-help",
|
|
139
|
-
handler: (_args, ctx) => sendAlias("/skill:lexis-two-help", "", ctx),
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
pi.on("input", async (event) => {
|
|
143
|
-
if (event?.source === "extension") return;
|
|
144
|
-
|
|
145
|
-
const text = String(event?.text || "");
|
|
146
|
-
if (currentMode !== "off" && /\b(stop lexis|normal mode)\b/i.test(text)) {
|
|
147
|
-
setMode("off");
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
pi.on("session_start", async (_event, ctx) => {
|
|
152
|
-
const entries = ctx?.sessionManager?.getBranch?.() || ctx?.sessionManager?.getEntries?.() || [];
|
|
153
|
-
configuredDefaultMode = getDefaultMode();
|
|
154
|
-
currentMode = resolveSessionMode(entries, configuredDefaultMode);
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
pi.on("before_agent_start", async (event) => {
|
|
158
|
-
if (!currentMode || currentMode === "off") return;
|
|
159
|
-
return { systemPrompt: `${event.systemPrompt}\n\n${getLexisInstructions(currentMode)}` };
|
|
160
|
-
});
|
|
161
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import test from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import lexisExtension from "../index.js";
|
|
4
|
-
|
|
5
|
-
class MockPi {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.commands = {};
|
|
8
|
-
this.listeners = {};
|
|
9
|
-
this.entries = [];
|
|
10
|
-
this.userMessages = [];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
registerCommand(name, config) {
|
|
14
|
-
this.commands[name] = config;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
on(event, handler) {
|
|
18
|
-
this.listeners[event] = handler;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
appendEntry(type, data) {
|
|
22
|
-
this.entries.push({ type, data });
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
sendUserMessage(text, options) {
|
|
26
|
-
this.userMessages.push({ text, options });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
test("lexisExtension registers commands and listeners", () => {
|
|
31
|
-
const pi = new MockPi();
|
|
32
|
-
lexisExtension(pi);
|
|
33
|
-
|
|
34
|
-
assert.ok(pi.commands["lexis-two"]);
|
|
35
|
-
assert.ok(pi.commands["lexis-two-review"]);
|
|
36
|
-
assert.ok(pi.commands["lexis-two-audit"]);
|
|
37
|
-
assert.ok(pi.commands["lexis-two-debt"]);
|
|
38
|
-
assert.ok(pi.commands["lexis-two-plan"]);
|
|
39
|
-
assert.ok(pi.commands["lexis-two-security"]);
|
|
40
|
-
assert.ok(pi.commands["lexis-two-help"]);
|
|
41
|
-
|
|
42
|
-
assert.ok(pi.listeners["input"]);
|
|
43
|
-
assert.ok(pi.listeners["session_start"]);
|
|
44
|
-
assert.ok(pi.listeners["before_agent_start"]);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
test("lexisExtension command handlers trigger correctly", async () => {
|
|
48
|
-
const pi = new MockPi();
|
|
49
|
-
lexisExtension(pi);
|
|
50
|
-
|
|
51
|
-
let notified = null;
|
|
52
|
-
const ctx = {
|
|
53
|
-
ui: {
|
|
54
|
-
notify: (msg, type) => {
|
|
55
|
-
notified = { msg, type };
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
await pi.commands["lexis-two"].handler("lite", ctx);
|
|
61
|
-
assert.equal(pi.entries[0].type, "lexis-two-mode");
|
|
62
|
-
assert.equal(pi.entries[0].data.mode, "lite");
|
|
63
|
-
assert.equal(notified.msg, "Lexis-Two mode set to lite.");
|
|
64
|
-
|
|
65
|
-
pi.commands["lexis-two-review"].handler("", ctx);
|
|
66
|
-
assert.equal(pi.userMessages[0].text, "/skill:lexis-two-review");
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test("lexisExtension input listener detects deactivation", async () => {
|
|
70
|
-
const pi = new MockPi();
|
|
71
|
-
lexisExtension(pi);
|
|
72
|
-
|
|
73
|
-
let notified = null;
|
|
74
|
-
const ctx = {
|
|
75
|
-
ui: {
|
|
76
|
-
notify: (msg, type) => {
|
|
77
|
-
notified = { msg, type };
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// Set mode to full first
|
|
83
|
-
await pi.commands["lexis-two"].handler("full", ctx);
|
|
84
|
-
assert.equal(pi.entries[0].data.mode, "full");
|
|
85
|
-
|
|
86
|
-
// Send input "stop lexis"
|
|
87
|
-
await pi.listeners["input"]({ text: "Please stop lexis now" });
|
|
88
|
-
assert.equal(pi.entries[1].data.mode, "off");
|
|
89
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import test from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import { resolveSessionMode, parseLexisCommand } from "../index.js";
|
|
4
|
-
|
|
5
|
-
test("resolveSessionMode resolves mode from branch entries", () => {
|
|
6
|
-
const entries = [
|
|
7
|
-
{ type: "user-message", text: "hello" },
|
|
8
|
-
{ type: "custom", customType: "lexis-two-mode", data: { mode: "lite" } },
|
|
9
|
-
{ type: "assistant-message", text: "world" },
|
|
10
|
-
];
|
|
11
|
-
assert.equal(resolveSessionMode(entries, "full"), "lite");
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
test("resolveSessionMode falls back to default mode if no entries", () => {
|
|
15
|
-
assert.equal(resolveSessionMode([], "lite"), "lite");
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test("parseLexisCommand parses empty command as default toggle", () => {
|
|
19
|
-
assert.deepEqual(parseLexisCommand("", "full"), { type: "set-mode", mode: "full" });
|
|
20
|
-
assert.deepEqual(parseLexisCommand(" ", "off"), { type: "set-mode", mode: "full" });
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test("parseLexisCommand parses status command", () => {
|
|
24
|
-
assert.deepEqual(parseLexisCommand("status"), { type: "status" });
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
test("parseLexisCommand parses default command", () => {
|
|
28
|
-
assert.deepEqual(parseLexisCommand("default lite"), { type: "set-default", mode: "lite" });
|
|
29
|
-
assert.deepEqual(parseLexisCommand("default invalid"), { type: "invalid", reason: "invalid-default-mode" });
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
test("parseLexisCommand parses mode command", () => {
|
|
33
|
-
assert.deepEqual(parseLexisCommand("ultra"), { type: "set-mode", mode: "ultra" });
|
|
34
|
-
assert.deepEqual(parseLexisCommand("invalid"), { type: "invalid", reason: "invalid-mode", mode: "invalid" });
|
|
35
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// lexis-two — rule copy integrity check
|
|
3
|
-
//
|
|
4
|
-
// To avoid runtime overhead, instruction-tier hosts (Windsurf, Cline, Kiro,
|
|
5
|
-
// Cursor) load static copies of the rules. This script acts as a build/CI guard
|
|
6
|
-
// to ensure those copies never drift from the canonical source (AGENTS.md).
|
|
7
|
-
//
|
|
8
|
-
// It asserts that:
|
|
9
|
-
// 1. Every rule copy file exists.
|
|
10
|
-
// 2. Every copy is completely identical to AGENTS.md (ignoring host-specific frontmatter).
|
|
11
|
-
// 3. The canonical AGENTS.md itself contains the load-bearing Lexis-Two rules.
|
|
12
|
-
|
|
13
|
-
const fs = require('fs');
|
|
14
|
-
const path = require('path');
|
|
15
|
-
|
|
16
|
-
const root = path.join(__dirname, '..');
|
|
17
|
-
|
|
18
|
-
// Canonical source of truth
|
|
19
|
-
const SOURCE_FILE = 'AGENTS.md';
|
|
20
|
-
|
|
21
|
-
// Static copies to validate
|
|
22
|
-
const COPIES = [
|
|
23
|
-
'.windsurf/rules/lexis-two.md',
|
|
24
|
-
'.clinerules/lexis-two.md',
|
|
25
|
-
'.kiro/steering/lexis-two.md',
|
|
26
|
-
'.cursor/rules/lexis-two.mdc',
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
// Load-bearing phrases that MUST exist in the source of truth. If these are
|
|
30
|
-
// missing, the source file has been gutted, and the copies are validating
|
|
31
|
-
// against an empty shell.
|
|
32
|
-
const INVARIANTS = [
|
|
33
|
-
'lazy senior',
|
|
34
|
-
'Input validation at trust boundaries',
|
|
35
|
-
'YAGNI',
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
function read(relPath) {
|
|
39
|
-
try {
|
|
40
|
-
return fs.readFileSync(path.join(root, relPath), 'utf8');
|
|
41
|
-
} catch (e) {
|
|
42
|
-
console.error(`Error: failed to read ${relPath}`);
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// 1. Validate canonical source
|
|
48
|
-
const source = read(SOURCE_FILE);
|
|
49
|
-
for (const phrase of INVARIANTS) {
|
|
50
|
-
if (!source.includes(phrase)) {
|
|
51
|
-
console.error(`Error: canonical source (${SOURCE_FILE}) is missing load-bearing rule: "${phrase}"`);
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Helper to strip frontmatter (metadata blocks between '---' at start of file)
|
|
57
|
-
function stripFrontmatter(content) {
|
|
58
|
-
return content.replace(/^---[\s\S]*?---\s*/, '');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// 2. Validate copies
|
|
62
|
-
let failed = false;
|
|
63
|
-
const canonicalBody = stripFrontmatter(source).trim();
|
|
64
|
-
|
|
65
|
-
for (const copyPath of COPIES) {
|
|
66
|
-
const copyContent = read(copyPath);
|
|
67
|
-
const copyBody = stripFrontmatter(copyContent).trim();
|
|
68
|
-
|
|
69
|
-
if (copyBody !== canonicalBody) {
|
|
70
|
-
console.error(`Drift detected: ${copyPath} does not match ${SOURCE_FILE}`);
|
|
71
|
-
failed = true;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (failed) {
|
|
76
|
-
console.error('\nIntegrity check FAILED. Rule copies have drifted from AGENTS.md.');
|
|
77
|
-
console.error('To fix, copy AGENTS.md content into the drifted files, preserving their frontmatter if any.');
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
console.log('Rule copy integrity check PASSED.');
|
|
82
|
-
process.exit(0);
|
package/site/astro.config.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "astro/config";
|
|
2
|
-
import sitemap from "@astrojs/sitemap";
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
site: "https://lexis-two.excelso.xyz",
|
|
6
|
-
output: "static",
|
|
7
|
-
i18n: {
|
|
8
|
-
defaultLocale: "en",
|
|
9
|
-
locales: ["en", "es"],
|
|
10
|
-
routing: {
|
|
11
|
-
prefixDefaultLocale: false,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
build: {
|
|
15
|
-
format: "directory",
|
|
16
|
-
},
|
|
17
|
-
integrations: [sitemap()],
|
|
18
|
-
});
|