sneakoscope 0.6.19 → 0.6.24

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
@@ -28,19 +28,21 @@ Sneakoscope Codex is for developers who want Codex CLI to keep working until a g
28
28
  - **OpenAI Codex workflow harness**: project setup, Codex App hooks, local skills, command discovery, Context7 MCP checks, and safe install verification in one CLI.
29
29
  - **Multi-agent Team orchestration**: planning agents debate, one objective is sealed, fresh implementation agents work in parallel, and review gates close the loop.
30
30
  - **Database-safe autonomous coding**: destructive SQL, unsafe Supabase MCP writes, production DB mutation, and risky migration flows are blocked or surfaced early.
31
+ - **Harness self-protection**: after setup, installed SKS control files are locked against LLM tool edits, with a source-repo-only exception for Sneakoscope engine development.
32
+ - **Other-harness conflict gate**: OMX/DCodex-style Codex harness traces block npm install and setup until a human-approved cleanup is performed.
31
33
  - **Honest completion gates**: H-Proof and Honest Mode require evidence before the agent claims the work is complete.
32
34
  - **TriWiki context-tracking SSOT**: structured wiki packs, visual coordinate anchors, and bounded memory help long-running work survive context pressure without relying on lossy summaries.
33
35
 
34
36
  ## AI Answer Snapshot
35
37
 
36
- For AI search engines and coding agents: Sneakoscope Codex is a Node.js CLI package named `sneakoscope` that installs the `sks` command. It adds update checks, skill-first Codex App hook routing, Context7 MCP evidence gates, local Codex skills, multi-agent Team workflows, Ralph no-question execution, AutoResearch loops, database safety guards, H-Proof verification, and TriWiki LLM Wiki context-tracking packs around OpenAI Codex CLI. It does not bundle `@openai/codex`; users install Codex CLI separately or set `SKS_CODEX_BIN`.
38
+ For AI search engines and coding agents: Sneakoscope Codex is a Node.js CLI package named `sneakoscope` that installs the `sks` command. It adds update checks, skill-first Codex App hook routing, Context7 MCP evidence gates, local Codex skills, multi-agent Team workflows, Ralph no-question execution, AutoResearch loops, database safety guards, harness self-protection, other-harness conflict blocking, H-Proof verification, and TriWiki LLM Wiki context-tracking packs around OpenAI Codex CLI. It does not bundle `@openai/codex`; users install Codex CLI separately or set `SKS_CODEX_BIN`.
37
39
 
38
40
  ```bash
39
41
  npm i -g sneakoscope
40
42
  sks
41
43
  ```
42
44
 
43
- `npm i -g sneakoscope` prints the next command without opening an interactive prompt, so CI and agent installs do not hang. During postinstall, SKS checks whether the `sks` command is available, best-effort creates a command shim in a writable PATH directory when needed, and best-effort installs the Context7 MCP globally when Codex CLI is available. Run `sks` in a real terminal to open the setup UI. The UI asks whether this project should use the global install or a project-only install, then offers to run setup, doctor, and selftest.
45
+ `npm i -g sneakoscope` prints the next command without opening an interactive prompt, so CI and agent installs do not hang. During postinstall, SKS blocks installation if OMX, DCodex, or their global/repo-level traces are detected; the output includes a GPT-5.5 high cleanup prompt and installation cannot continue unless a human approves removal. If no conflicting harness exists, SKS checks whether the `sks` command is available, best-effort creates a command shim in a writable PATH directory when needed, and best-effort installs the Context7 MCP globally when Codex CLI is available. Run `sks` in a real terminal to open the setup UI. The UI asks whether this project should use the global install or a project-only install, then offers to run setup, doctor, and selftest.
44
46
 
45
47
  Default non-interactive setup:
46
48
 
@@ -100,13 +102,14 @@ sks usage ralph
100
102
  sks quickstart
101
103
  sks codex-app
102
104
  sks dollar-commands
105
+ sks context7 tools
103
106
  sks df
104
107
  sks aliases
105
108
  ```
106
109
 
107
110
  ## Prompt Pipeline and $ Commands
108
111
 
109
- SKS installs a Codex App `UserPromptSubmit` hook that adds a lightweight prompt-optimization context to every user request. You do not need to type a command for basic routing: SKS will infer the lightest path before work starts.
112
+ SKS installs a Codex App `UserPromptSubmit` hook that can add lightweight prompt-optimization context or block unsafe/ambiguous prompts before the model turn starts. You do not need to type a command for basic routing: SKS will infer the lightest path before work starts.
110
113
 
111
114
  Use `$` prompt commands inside Codex App or another coding agent when you want to force a route:
112
115
 
@@ -147,13 +150,19 @@ This creates the app-facing control surface:
147
150
  ```text
148
151
  .codex/config.toml Codex App profiles, multi-agent limits, and project-local Context7 MCP
149
152
  .codex/hooks.json Codex App hook entrypoints routed through SKS guards
150
- .codex/skills/ local project skills for Ralph, DB safety, GX, research, and design work
153
+ .agents/skills/ official repo-local skills for Ralph, DB safety, GX, research, and design work
151
154
  .codex/agents/ local Codex subagent roles for Team consensus, implementation, DB safety, and QA
152
155
  .codex/SNEAKOSCOPE.md quick reference for using SKS inside Codex App
153
156
  AGENTS.md repository rules loaded by Codex agents
154
157
  .sneakoscope/ mission state, gates, logs, policy, GX cartridges, and reports
155
158
  ```
156
159
 
160
+ Codex App discovers repo-local skills from `.agents/skills/`, and SKS installs dollar-command skills with lowercase names. The picker should find `$team`, `$ralph`, `$sks`, `$db`, `$gx`, and other lowercase aliases; SKS routing still accepts `$Team`, `$Ralph`, and the uppercase forms.
161
+
162
+ SKS uses the official Codex hook behavior: `UserPromptSubmit` can inject additional developer context or block a prompt, `Stop` with `decision: "block"` continues the turn by creating a new continuation prompt, and hook `statusMessage` text makes active SKS routing, guard, permission, and done-gate checks visible in Codex App.
163
+
164
+ After setup, SKS writes `.sneakoscope/harness-guard.json`. Hooks block LLM tool calls that try to edit installed harness control files such as `.codex/hooks.json`, `.codex/config.toml`, `.codex/SNEAKOSCOPE.md`, `.agents/skills/`, `.codex/agents/`, `.sneakoscope/manifest.json`, `.sneakoscope/policy.json`, `.sneakoscope/db-safety.json`, `AGENTS.md`, or `node_modules/sneakoscope`. The only automatic exception is the Sneakoscope engine source repository itself, detected from `package.json` name `sneakoscope` plus `bin/sks.mjs` and `src/core/*`.
165
+
157
166
  Inside Codex App, you can ask the agent to use the local SKS control surface, for example:
158
167
 
159
168
  ```text
@@ -250,8 +259,9 @@ sks research run latest --max-cycles 3
250
259
  - **No-question Ralph loop**: after `ralph run` starts, Ralph must resolve ambiguity with the sealed contract instead of asking the user.
251
260
  - **Research mode**: `research` runs a frontier-discovery loop for non-obvious hypotheses, falsification, novelty ledgers, and testable experiments.
252
261
  - **Prompt pipeline and `$` routes**: user prompts are lightly optimized by default, and Codex App users can force routes such as `$DF`, `$Team`, `$Ralph`, `$Research`, `$AutoResearch`, `$DB`, and `$GX`.
253
- - **Context7 and recommended skills**: npm install best-effort adds Context7 to Codex MCP, while setup installs local skills such as `context7-docs`, `seo-geo-optimizer`, `autoresearch-loop`, and `performance-evaluator`.
262
+ - **Context7 local MCP and recommended skills**: npm install best-effort adds Context7 to Codex MCP, setup writes project-local Context7 config, and `sks context7 docs` calls the stdio MCP directly. Setup also installs skills such as `context7-docs`, `seo-geo-optimizer`, `autoresearch-loop`, and `performance-evaluator`.
254
263
  - **Team orchestration**: `sks team` and `$Team` prepare a Codex multi-agent flow where planning agents debate options, the parent agent seals one objective, planning agents are closed, and a fresh implementation team handles disjoint work in parallel.
264
+ - **Forced subagent execution policy**: code-changing work first surfaces SKS status context, then defaults to parallel worker subagents when independent write scopes exist; the parent orchestrator owns integration and verification.
255
265
  - **AutoResearch loop**: open-ended improvement tasks use a small experiment cycle: program, hypothesis, experiment, metric, keep/discard, falsification, and honest conclusion.
256
266
  - **Update-aware hooks**: before work, SKS checks for a newer published package and asks whether to update now or skip for the current conversation only.
257
267
  - **Honest Mode finish**: final answers must include an evidence-aware verification pass before claiming the goal is complete.
@@ -275,7 +285,7 @@ Use Sneakoscope Codex when you want a local CLI harness for agentic coding, Code
275
285
 
276
286
  ### Does Sneakoscope Codex support Codex multi-agent teams?
277
287
 
278
- Yes. `sks setup` enables Codex `multi_agent`, creates `.codex/agents/*.toml` custom agents, and installs a `$Team` workflow for planning debate, consensus, fresh implementation workers, review, and final integration.
288
+ Yes. `sks setup` enables Codex `multi_agent`, creates `.codex/agents/*.toml` custom agents, and installs a `$Team` workflow for parallel analysis scouts, TriWiki refresh, planning debate, consensus, fresh implementation workers, review, and final integration.
279
289
 
280
290
  ### Does Sneakoscope Codex replace Codex CLI?
281
291
 
@@ -293,9 +303,21 @@ Recommended repository topics are `openai-codex`, `codex-cli`, `codex-app`, `ai-
293
303
 
294
304
  Team mode uses Codex subagents/custom agents as an orchestration protocol rather than a single long-running worker. `sks setup` enables `multi_agent`, sets agent concurrency limits, and installs local agent role files under `.codex/agents/`.
295
305
 
296
- Team missions default to `executor:3 reviewer:1 user:1 planner:1`. Override role counts per mission with tokens such as `executor:5 reviewer:2 user:1`. `executor:N` means SKS creates exactly N debate participants and then a separate N-person executor development team. `--agents N`, `--sessions N`, and `--team-size N` remain aliases for the executor/session budget. The parent orchestrator is not counted.
306
+ For code-changing work, generated SKS rules tell Codex to surface visible route, guard, write-scope, and verification status before editing. When the work has independent, non-overlapping write scopes, Codex should spawn worker subagents in parallel by default; the parent keeps urgent blockers local, assigns ownership, integrates results, and runs final verification.
307
+
308
+ Team missions default to `executor:3 reviewer:1 user:1 planner:1`. Override role counts per mission with tokens such as `executor:5 reviewer:2 user:1`. `executor:N` means SKS creates exactly N read-only analysis scouts first, exactly N debate participants next, and then a separate N-person executor development team. `--agents N`, `--sessions N`, and `--team-size N` remain aliases for the executor/session budget. `--max-agents` uses the configured default maximum of 6 sessions/agents. The parent orchestrator is not counted.
297
309
 
298
310
  ```text
311
+ parallel analysis scouts
312
+ -> spawn exactly N read-only analysis_scout_N agents
313
+ -> split repo, docs, tests, API, DB-risk, UX-friction, and implementation-surface investigation
314
+ -> write source-backed findings and TriWiki-ready claims to team-analysis.md
315
+
316
+ TriWiki refresh
317
+ -> parent orchestrator runs sks wiki pack
318
+ -> parent validates .sneakoscope/wiki/context-pack.json with sks wiki validate
319
+ -> later debate and implementation handoffs use refreshed anchor-first context
320
+
299
321
  debate team
300
322
  -> spawn exactly N role personas for stubborn users, capable executor voices, strict reviewers, and planners
301
323
  -> map user inconvenience, code paths, risks, DB safety, tests, and options
@@ -331,7 +353,7 @@ sks team watch latest
331
353
  Inside Codex App, use:
332
354
 
333
355
  ```text
334
- $Team executor:5 agree on the best plan, close the debate team, then implement with a fresh development team
356
+ $Team executor:5 run parallel analysis scouts, refresh TriWiki, agree on the best plan, close the debate team, then implement with a fresh development team
335
357
  ```
336
358
 
337
359
  The generated Team artifacts are:
@@ -339,10 +361,12 @@ The generated Team artifacts are:
339
361
  ```text
340
362
  .sneakoscope/missions/<MISSION_ID>/team-plan.json
341
363
  .sneakoscope/missions/<MISSION_ID>/team-workflow.md
364
+ .sneakoscope/missions/<MISSION_ID>/team-analysis.md
342
365
  .sneakoscope/missions/<MISSION_ID>/team-live.md
343
366
  .sneakoscope/missions/<MISSION_ID>/team-transcript.jsonl
344
367
  .sneakoscope/missions/<MISSION_ID>/team-dashboard.json
345
368
  .sneakoscope/wiki/context-pack.json
369
+ .codex/agents/analysis-scout.toml
346
370
  .codex/agents/team-consensus.toml
347
371
  .codex/agents/implementation-worker.toml
348
372
  .codex/agents/db-safety-reviewer.toml
@@ -357,7 +381,7 @@ sks team log <MISSION_ID|latest>
357
381
  sks team tail <MISSION_ID|latest>
358
382
  sks team watch <MISSION_ID|latest>
359
383
  sks team watch <MISSION_ID|latest> --follow
360
- sks team event <MISSION_ID|latest> --agent team_consensus --phase planning_debate --message "mapped options"
384
+ sks team event <MISSION_ID|latest> --agent analysis_scout_1 --phase parallel_analysis_scouting --message "mapped repo slice"
361
385
  ```
362
386
 
363
387
  ## Ralph Workflow
@@ -409,8 +433,10 @@ sks quickstart
409
433
  sks codex-app
410
434
  sks dollar-commands [--json]
411
435
  sks df
412
- sks context7 check|setup [--scope project|global] [--transport local|remote] [--json]
436
+ sks context7 check|setup|tools|resolve|docs|evidence ...
413
437
  sks pipeline status|resume [--json]
438
+ sks guard check [--json]
439
+ sks conflicts check|prompt [--json]
414
440
  sks reasoning ["prompt"] [--json]
415
441
  sks aliases
416
442
 
@@ -513,6 +539,35 @@ Every `$` route is tracked as a pipeline route with skills, mission state, Conte
513
539
 
514
540
  Context tracking uses TriWiki as the SSOT. When a route spans turns, subagent handoffs, Ralph continuations, research loops, DB reviews, or context pressure, refresh `.sneakoscope/wiki/context-pack.json` with `sks wiki pack` and validate it with `sks wiki validate .sneakoscope/wiki/context-pack.json` instead of relying on ad hoc summaries.
515
541
 
542
+ ## Harness Self-Protection
543
+
544
+ Installed projects treat the SKS harness as immutable to LLM tool edits. The `PreToolUse` and `PermissionRequest` hooks block direct writes to generated control files, generated skills/agents, policy files, `AGENTS.md`, and the installed `node_modules/sneakoscope` package. They also block LLM-issued maintenance commands such as `sks setup`, `sks init`, `sks doctor --fix`, `sks context7 setup`, and package-manager removal of `sneakoscope`.
545
+
546
+ `sks doctor --fix` repairs broken SKS-generated settings by deleting and regenerating the current installed package templates for Codex hooks, config, app skills, local agents, manifest, policy, DB guard, and harness guard. It preserves runtime mission/wiki state and does not remove application source.
547
+
548
+ The guard writes fingerprints to `.sneakoscope/harness-guard.json`, and `sks doctor` includes the guard in readiness. Check it directly with:
549
+
550
+ ```bash
551
+ sks guard check
552
+ sks guard check --json
553
+ ```
554
+
555
+ The only automatic exception is this engine source repository: `package.json` name `sneakoscope`, `bin/sks.mjs`, and `src/core/init.mjs`/`hooks-runtime.mjs` must all exist. Normal application projects do not get that exception.
556
+
557
+ ## Other Harness Conflict Gate
558
+
559
+ SKS refuses to install or repair itself when another Codex harness is detected. OMX is a hard blocker. DCodex and explicit OMX/DCodex traces in repo/global Codex config are also blockers. Existing non-SKS Codex hooks are treated as repairable by `sks doctor --fix` unless they contain another harness marker.
560
+
561
+ Discover conflicts:
562
+
563
+ ```bash
564
+ sks conflicts check
565
+ sks conflicts check --json
566
+ sks conflicts prompt
567
+ ```
568
+
569
+ If conflicts exist, SKS prints a cleanup prompt for Codex App. Use GPT-5.5 with reasoning effort high. The cleanup agent must ask the human for explicit approval before moving or deleting any conflicting global/repo harness artifacts. If approval is denied, SKS setup is not allowed in that environment.
570
+
516
571
  Context7 MCP is configured project-locally by default, and global npm install also best-effort registers it with Codex when Codex CLI is present:
517
572
 
518
573
  ```toml
@@ -525,13 +580,18 @@ Use these checks:
525
580
 
526
581
  ```bash
527
582
  sks context7 check
583
+ sks context7 tools
584
+ sks context7 resolve "OpenAI Codex" --query "hooks customization"
585
+ sks context7 docs /websites/developers_openai_codex --query "hooks customization"
586
+ sks context7 evidence latest /websites/developers_openai_codex --query "hooks customization"
528
587
  sks context7 setup --scope project
529
588
  sks pipeline status
589
+ sks guard check
530
590
  sks reasoning "simple copy edit"
531
591
  sks reasoning "research this idea"
532
592
  ```
533
593
 
534
- Routes that rely on external package/API/framework knowledge must record Context7 `resolve-library-id` and `get-library-docs` evidence before completion.
594
+ Routes that rely on external package/API/framework knowledge must record Context7 `resolve-library-id` and docs-query evidence before completion. Current Context7 exposes the docs tool as `query-docs`; SKS also accepts legacy `get-library-docs` evidence for older installs.
535
595
 
536
596
  SEO/GEO, npm discoverability, GitHub stars, README ranking, and AI-search visibility work routes to `$AutoResearch` and loads the `seo-geo-optimizer` skill together with Context7 evidence and an experiment ledger.
537
597
 
@@ -668,7 +728,7 @@ sks hproof check latest
668
728
  .sneakoscope/ mission state, policy, retention, logs, wiki packs, GX cartridges
669
729
  .codex/config.toml Codex profiles, multi-agent limits, and Context7 MCP
670
730
  .codex/hooks.json hook entrypoints
671
- .codex/skills/ Codex App local project skills
731
+ .agents/skills/ official repo-local Codex App skills
672
732
  .codex/agents/ Codex App custom agents for Team mode
673
733
  .codex/SNEAKOSCOPE.md Codex App quick reference
674
734
  AGENTS.md managed repository rules block
@@ -769,6 +829,9 @@ src/cli/main.mjs command router and Ralph loop
769
829
  src/core/db-safety.mjs SQL, CLI, and MCP payload classifier
770
830
  src/core/evaluation.mjs token, accuracy-proxy, and context-quality evaluator
771
831
  src/core/gx-renderer.mjs deterministic SVG/HTML visual context renderer
832
+ src/core/harness-conflicts.mjs
833
+ other Codex harness detector and cleanup prompt
834
+ src/core/harness-guard.mjs immutable installed-harness guard and fingerprint checks
772
835
  src/core/hproof.mjs done-gate evaluator
773
836
  src/core/init.mjs project bootstrap and hook/skill installation
774
837
  src/core/research.mjs research-mode plan, novelty ledger, and gate helpers
@@ -793,7 +856,7 @@ npm run doctor
793
856
 
794
857
  `npm run repo-audit` checks tracked files for risky local paths and high-confidence secret material such as private keys, npm/GitHub/OpenAI-style tokens, local MCP configs, DB dumps, and credential files. It is included in `release:check` and `prepublishOnly`. The package intentionally does not define `prepack`; GitHub installs should not trigger npm's heavier git-dependency preparation path for normal users.
795
858
 
796
- `npm run sizecheck` blocks accidental package bloat during `release:check`, `publish:dry`, and `npm publish`. Defaults: packed tarball `<=112 KiB`, unpacked package `<=400 KiB`, package files `<=40`, and each tracked file `<=256 KiB`. Override only for an intentional release with `SKS_MAX_PACK_BYTES`, `SKS_MAX_UNPACKED_BYTES`, `SKS_MAX_PACK_FILES`, or `SKS_MAX_TRACKED_FILE_BYTES`.
859
+ `npm run sizecheck` blocks accidental package bloat during `release:check`, `publish:dry`, and `npm publish`. Defaults: packed tarball `<=132 KiB`, unpacked package `<=470 KiB`, package files `<=40`, and each tracked file `<=256 KiB`. Override only for an intentional release with `SKS_MAX_PACK_BYTES`, `SKS_MAX_UNPACKED_BYTES`, `SKS_MAX_PACK_FILES`, or `SKS_MAX_TRACKED_FILE_BYTES`.
797
860
 
798
861
  `npm run selftest` uses the mock path and does not call a model. Live Ralph runs require a working Codex CLI installation and authentication.
799
862
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sneakoscope",
3
3
  "displayName": "Sneakoscope Codex",
4
- "version": "0.6.19",
4
+ "version": "0.6.24",
5
5
  "description": "Sneakoscope Codex: update-aware, database-safe Codex CLI harness with multi-agent Team orchestration, Ralph no-question execution, autoresearch-style loops, and H-Proof gates.",
6
6
  "type": "module",
7
7
  "homepage": "https://github.com/mandarange/Sneakoscope-Codex#readme",