litcodex-ai 0.3.13 → 0.3.15

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 CHANGED
@@ -64,8 +64,8 @@ LitCodex also ships a sibling family of triggers and phrases — `litwork`, `lit
64
64
  `lit start work` handoff — alongside a 24-skill library and hook components, all registered as a
65
65
  single Codex plugin.
66
66
 
67
- The bundled `public-page-reader` skill adds a public-only retrieval workflow with safety preflight,
68
- content validation, trace evidence, and deterministic A/B checks for blocked or misleading pages.
67
+ The bundled `public-page-reader` skill adds a public-only Node stdlib runtime with safety preflight,
68
+ unsafe redirect blocking, content validation, trace evidence, and deterministic A/B checks.
69
69
 
70
70
  > [!TIP]
71
71
  > See the [repository README](https://github.com/wjgoarxiv/litcodex#readme) for the full quickstart,
@@ -16,6 +16,7 @@ If the latest parent message starts with `TASK STILL ACTIVE:`, immediately retur
16
16
  Verdict rules:
17
17
  - Return `UNCONDITIONAL APPROVAL` only when the diff satisfies every success criterion and the evidence proves the real surface works.
18
18
  - Return `REJECTION` if any criterion lacks evidence, any test is missing, the diff has avoidable risk, or the implementation drifts beyond the request.
19
+ - Return `REJECTION` for minimum-first drift: custom code where existing code, the standard library, a native platform/framework feature, an installed dependency, or one clear line would satisfy the goal; unnecessary helpers, layers, config, tests, docs, or speculative generality; or any external-source term/phrase introduced into product files.
19
20
  - Treat "looks good but..." as rejection. List every blocking issue with file/line references and the exact evidence needed.
20
21
 
21
22
  Be concise, specific, and strict."""
@@ -20,7 +20,7 @@ When the caller says "do X / fix X / build X" - interpret it as "create a work p
20
20
  - AVOID me when: the change is a single-file edit with an obvious pattern, or the caller already has a plan and just wants execution.
21
21
 
22
22
  # Goal
23
- Deliver ONE executable plan that a downstream executor can follow with no further interview. Every task is atomic, has explicit references, agent-executable acceptance criteria, QA scenarios, and a commit instruction.
23
+ Deliver ONE executable plan that a downstream executor can follow with no further interview. Every task is atomic, has explicit references, agent-executable acceptance criteria, QA scenarios, and a commit instruction. Apply minimum-first planning: if the outcome can be a single-task or few-task plan, do that instead of manufacturing waves; before adding work, check whether to skip, reuse existing code, use standard library/native/platform features, or reuse an installed dependency.
24
24
 
25
25
  # Phase 1 - Context gathering (MANDATORY BEFORE PLANNING)
26
26
  Never plan blind. Fire parallel research BEFORE drafting:
@@ -35,7 +35,7 @@ Wait for context to converge before drafting. Rushed plans fail.
35
35
 
36
36
  # Phase 2 - Plan output (single markdown file, single plan)
37
37
 
38
- Write the plan to `.litcodex/plans/<slug>.md` in the working tree (create the `.litcodex/plans/` directory if absent). One plan per request - no "Phase 1 plan / Phase 2 plan" splits. 50+ tasks is fine if the work demands it.
38
+ Write the plan to `.litcodex/plans/<slug>.md` in the working tree (create the `.litcodex/plans/` directory if absent). One plan per request - no "Phase 1 plan / Phase 2 plan" splits. A single-task or few-task plan is correct for small work; 50+ tasks is fine only when the verified scope truly demands it.
39
39
 
40
40
  Use this template verbatim (fill the placeholders):
41
41
 
@@ -54,6 +54,7 @@ Use this template verbatim (fill the placeholders):
54
54
 
55
55
  ### Must NOT have (guardrails, anti-slop, scope boundaries)
56
56
  - ...
57
+ - Minimum-first guard: do not add work that can be skipped, solved by reusing existing code, handled by the standard library/native platform, covered by an installed dependency, or expressed as one clear line.
57
58
 
58
59
  ## Verification strategy
59
60
  > Zero human intervention - all verification is agent-executed.
@@ -63,8 +64,8 @@ Use this template verbatim (fill the placeholders):
63
64
 
64
65
  ## Execution strategy
65
66
  ### Parallel execution waves
66
- > Target 5-8 tasks per wave. <3 per wave (except final) = under-splitting.
67
- > Extract shared dependencies as Wave-1 tasks to maximize parallelism.
67
+ > For large independent work, target 5-8 tasks per wave. For small work, prefer a single-task or few-task plan; do not split merely to fill a wave.
68
+ > Extract shared dependencies as Wave-1 tasks only when they are real blockers, not speculative abstractions.
68
69
 
69
70
  Wave 1 (no dependencies):
70
71
  - Task 1: <desc>
@@ -166,7 +166,7 @@ automatic interview-to-plan transition.
166
166
  2. If native Codex Plan Mode is active, return ONE complete
167
167
  `<proposed_plan>...</proposed_plan>` using the template below and do not write
168
168
  a file. Otherwise write ONE plan to `.litcodex/plans/<slug>.md`. No
169
- "Phase 1 plan / Phase 2 plan" splits; 50+ todos is fine. Build it
169
+ "Phase 1 plan / Phase 2 plan" splits; a single-task or few-task plan is correct for small work, and 50+ todos is fine only when verified scope demands it. Build it
170
170
  incrementally — skeleton first, then append todo batches — so output limits
171
171
  never truncate it; re-read the file with the `shell` tool to confirm
172
172
  completeness.
@@ -187,6 +187,7 @@ automatic interview-to-plan transition.
187
187
  ## Scope
188
188
  ### Must have
189
189
  ### Must NOT have (guardrails, anti-slop, scope boundaries)
190
+ - minimum-first guard: do not plan work that can be skipped, solved by reusing existing code, handled by the standard library/native platform, covered by an installed dependency, or expressed as one clear line.
190
191
 
191
192
  ## Verification strategy
192
193
  > Zero human intervention — all verification is agent-executed.
@@ -196,7 +197,7 @@ automatic interview-to-plan transition.
196
197
 
197
198
  ## Execution strategy
198
199
  ### Parallel execution waves
199
- > Target 5-8 todos per wave. < 3 per wave (except the final) = under-splitting.
200
+ > For large independent work, target 5-8 todos per wave. For small work, prefer a single-task or few-task plan; do not split merely to fill a wave.
200
201
  Wave 1 (no deps): ...
201
202
  Wave 2 (after 1): ...
202
203
  Critical path: ...
@@ -9,7 +9,7 @@ separately asks for implementation after the synthesis.
9
9
 
10
10
  # Durable journal
11
11
 
12
- Create a session directory under `.litcodex/litresearch/<timestamp>/` and keep an append-only journal
12
+ Create a session directory under `.litcodex/lit-loop/litresearch/<timestamp>/` and keep an append-only journal
13
13
  there. Store worker digests, source notes, verification outputs, and the final synthesis in that
14
14
  directory. Workers may return findings, but the orchestrator owns the journal.
15
15
 
@@ -14,6 +14,10 @@ evidence or completion is blocked.
14
14
  2. **real-surface QA** — drive the actual hook, CLI, package, HTTP, browser, or desktop surface the
15
15
  user would touch. Capture command output, transcript, screenshot, response body, or log.
16
16
  3. **code quality** — inspect changed files for maintainability, coupling, test quality, and minimality.
17
+ Apply the minimum-first gate: reject avoidable custom code when existing code, the standard library,
18
+ a native platform/framework feature, an installed dependency, or one clear line would satisfy the
19
+ goal; also reject unnecessary helpers, layers, config, tests, docs, speculative generality, or any
20
+ external-source term/phrase introduced into product files.
17
21
  4. **security/safety** — check malformed input, prompt injection, secret handling, permissions,
18
22
  destructive actions, and unsafe publication/deploy paths.
19
23
  5. **context/docs/package** — verify docs, changelog, handoff, config/installer behavior, package
@@ -71,14 +71,14 @@ export function matchLitTrigger(prompt) {
71
71
  continue;
72
72
  }
73
73
  const index = (m.index ?? 0) + m[0].length - raw.length;
74
- if (isSlashCommandOrPathToken(prompt, index)) {
74
+ const token = raw.toLowerCase();
75
+ if (isSlashCommandOrPathToken(prompt, index, token)) {
75
76
  continue;
76
77
  }
77
78
  const phrase = raw.toLowerCase() === "lit" ? naturalPhraseAfterLit(prompt, searchable, index, raw.length) : null;
78
79
  if (phrase !== null) {
79
80
  return phrase;
80
81
  }
81
- const token = raw.toLowerCase();
82
82
  return { token, raw: prompt.slice(index, index + raw.length), index };
83
83
  }
84
84
  return null;
@@ -105,9 +105,12 @@ function naturalPhraseAfterLit(prompt, searchable, index, rawLength) {
105
105
  const rawLengthWithPhrase = rawLength + m[1].length + m[2].length;
106
106
  return { token, raw: prompt.slice(index, index + rawLengthWithPhrase), index };
107
107
  }
108
- function isSlashCommandOrPathToken(prompt, tokenIndex) {
108
+ function isSlashCommandOrPathToken(prompt, tokenIndex, token) {
109
109
  const prev = prompt[tokenIndex - 1];
110
- return prev === "/";
110
+ if (prev !== "/") {
111
+ return false;
112
+ }
113
+ return !(token === "litresearch" && tokenIndex === 1);
111
114
  }
112
115
  function maskRange(chars, start, end) {
113
116
  for (let i = start; i < end; i += 1) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litcodex/lit-loop",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "description": "LitCodex Lit-Loop runtime: durable repo-native multi-goal orchestration with embedded success criteria and observable evidence audit.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,7 +19,7 @@
19
19
  "scripts": {
20
20
  "build": "tsc -p tsconfig.build.json",
21
21
  "typecheck": "tsc --noEmit",
22
- "test": "vitest --run"
22
+ "test": "vitest --config vitest.config.ts --run"
23
23
  },
24
24
  "engines": {
25
25
  "node": ">=20.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "litcodex-ai",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "description": "Codex loop harness installer. Run `npx litcodex-ai install` to set up the LitCodex Codex platform: the bare `lit` hook and the durable lit-loop runtime.",
5
5
  "keywords": ["codex", "litcodex", "lit-loop", "ai-agents", "orchestration"],
6
6
  "author": "LitCodex Authors",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "files": ["bin", "dist", "model-catalog.json", "README.md", "LICENSE"],
17
17
  "dependencies": {
18
- "@litcodex/lit-loop": "0.3.13"
18
+ "@litcodex/lit-loop": "0.3.15"
19
19
  },
20
20
  "bundledDependencies": ["@litcodex/lit-loop"],
21
21
  "scripts": {