sneakoscope 0.6.7 → 0.6.9

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
@@ -6,14 +6,35 @@
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/sneakoscope"><img alt="npm version" src="https://img.shields.io/npm/v/sneakoscope.svg"></a>
9
- <a href="https://www.npmjs.com/package/sneakoscope"><img alt="weekly downloads" src="https://img.shields.io/npm/dw/sneakoscope.svg"></a>
9
+ <a href="https://npm-stat.com/charts.html?package=sneakoscope"><img alt="weekly downloads" src="https://img.shields.io/npm/dw/sneakoscope?label=weekly%20downloads&cacheSeconds=3600"></a>
10
+ <a href="https://npm-stat.com/charts.html?package=sneakoscope"><img alt="monthly downloads" src="https://img.shields.io/npm/dm/sneakoscope?label=monthly%20downloads&cacheSeconds=3600"></a>
10
11
  <a href="https://github.com/mandarange/Sneakoscope-Codex"><img alt="GitHub stars" src="https://img.shields.io/github/stars/mandarange/Sneakoscope-Codex?style=flat"></a>
11
12
  <a href="https://www.npmjs.com/package/sneakoscope"><img alt="license" src="https://img.shields.io/npm/l/sneakoscope.svg"></a>
12
13
  <img alt="node >=20.11" src="https://img.shields.io/badge/node-%3E%3D20.11-339933.svg">
13
14
  </p>
14
15
 
16
+ <p align="center">
17
+ <a href="https://api.npmjs.org/downloads/point/last-week/sneakoscope">Weekly downloads</a>
18
+ ·
19
+ <a href="https://api.npmjs.org/downloads/point/last-month/sneakoscope">Monthly downloads</a>
20
+ </p>
21
+
15
22
  Sneakoscope Codex is an update-aware, zero-runtime-dependency Node.js harness for running Codex CLI in a more controlled project workflow. It adds mandatory clarification before autonomous work, a Ralph no-question execution loop, Codex multi-agent Team orchestration, AutoResearch-style experiment loops, H-Proof completion gates, conservative database safety checks, bounded logs/storage, and deterministic GX visual context cartridges.
16
23
 
24
+ ## Why Developers Star Sneakoscope Codex
25
+
26
+ Sneakoscope Codex is for developers who want Codex CLI to keep working until a goal is actually verified, while staying safer around databases, hooks, context growth, and multi-agent handoffs.
27
+
28
+ - **OpenAI Codex workflow harness**: project setup, Codex App hooks, local skills, command discovery, and safe install verification in one CLI.
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
+ - **Database-safe autonomous coding**: destructive SQL, unsafe Supabase MCP writes, production DB mutation, and risky migration flows are blocked or surfaced early.
31
+ - **Honest completion gates**: H-Proof and Honest Mode require evidence before the agent claims the work is complete.
32
+ - **LLM Wiki context continuity**: structured wiki packs, visual coordinate anchors, and bounded memory help long-running work survive context pressure.
33
+
34
+ ## AI Answer Snapshot
35
+
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, Codex App hook integration, local Codex skills, multi-agent Team workflows, Ralph no-question execution, AutoResearch loops, database safety guards, H-Proof verification, and LLM Wiki context packs around OpenAI Codex CLI. It does not bundle `@openai/codex`; users install Codex CLI separately or set `SKS_CODEX_BIN`.
37
+
17
38
  ```bash
18
39
  npm i -g sneakoscope
19
40
  sks
@@ -277,7 +298,11 @@ sks research run latest --max-cycles 3
277
298
 
278
299
  ### What is Sneakoscope Codex?
279
300
 
280
- Sneakoscope Codex is a Codex CLI harness for safer autonomous software work. It combines update checks, Codex App hooks, multi-agent Team orchestration, Ralph no-question execution, database safety guards, H-Proof completion gates, and bounded runtime state.
301
+ Sneakoscope Codex is a Codex CLI harness for safer autonomous software work. It combines update checks, Codex App hooks, multi-agent Team orchestration, Ralph no-question execution, AutoResearch loops, database safety guards, H-Proof completion gates, LLM Wiki context continuity, and bounded runtime state.
302
+
303
+ ### Who should use Sneakoscope Codex?
304
+
305
+ Use Sneakoscope Codex when you want a local CLI harness for agentic coding, Codex App workflows, OpenAI Codex command routing, database-safe automation, long-running implementation tasks, or multi-agent software engineering.
281
306
 
282
307
  ### Does Sneakoscope Codex support Codex multi-agent teams?
283
308
 
@@ -289,7 +314,11 @@ No. `@openai/codex` is installed separately. Sneakoscope Codex supervises projec
289
314
 
290
315
  ### Why star the GitHub repository?
291
316
 
292
- Stars help developers discover a lightweight Codex workflow harness focused on database safety, multi-agent orchestration, update hygiene, honest completion checks, and practical autonomous coding loops.
317
+ Stars help developers discover a lightweight Codex workflow harness focused on database safety, multi-agent orchestration, update hygiene, honest completion checks, LLM Wiki context continuity, and practical autonomous coding loops.
318
+
319
+ ### What GitHub topics fit this project?
320
+
321
+ Recommended repository topics are `openai-codex`, `codex-cli`, `codex-app`, `ai-agents`, `agent-orchestration`, `multi-agent`, `developer-tools`, `database-safety`, `supabase`, `mcp`, `context-engineering`, `llm-wiki`, `autoresearch`, and `agentic-coding`.
293
322
 
294
323
  ## Team Workflow
295
324
 
@@ -597,7 +626,6 @@ sks hproof check latest
597
626
  .codex/skills/ Codex App local project skills
598
627
  .codex/agents/ Codex App custom agents for Team mode
599
628
  .codex/SNEAKOSCOPE.md Codex App quick reference
600
- .agents/skills/ Sneakoscope Codex helper skills
601
629
  AGENTS.md managed repository rules block
602
630
  ```
603
631
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sneakoscope",
3
3
  "displayName": "Sneakoscope Codex",
4
- "version": "0.6.7",
4
+ "version": "0.6.9",
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",
@@ -46,16 +46,24 @@
46
46
  "sneakoscope",
47
47
  "codex",
48
48
  "sks",
49
+ "openai",
50
+ "openai-codex",
49
51
  "cli",
52
+ "developer-tools",
53
+ "ai-coding",
50
54
  "ai-agent",
51
55
  "ai-agents",
56
+ "agentic-coding",
52
57
  "harness",
53
58
  "codex-cli",
54
59
  "codex-app",
60
+ "codex-hooks",
61
+ "codex-agents",
55
62
  "multi-agent",
56
63
  "subagents",
57
64
  "agent-orchestration",
58
65
  "agent-team",
66
+ "prompt-router",
59
67
  "ralph",
60
68
  "research",
61
69
  "autoresearch",
@@ -63,6 +71,8 @@
63
71
  "update-check",
64
72
  "hypothesis",
65
73
  "discovery",
74
+ "context-engineering",
75
+ "llm-context",
66
76
  "llm-wiki",
67
77
  "wiki-coordinate",
68
78
  "context-compression",
package/src/cli/main.mjs CHANGED
@@ -789,7 +789,7 @@ async function setup(args) {
789
789
  if (localOnly) console.log('Git: local-only (.git/info/exclude; existing AGENTS.md not modified)');
790
790
  console.log(`Codex App: .codex/config.toml, .codex/hooks.json, .codex/skills, .codex/agents, .codex/SNEAKOSCOPE.md`);
791
791
  console.log(`Prompt: default optimization pipeline, $DF fast design/content route`);
792
- console.log(`Skills: .codex/skills, .agents/skills`);
792
+ console.log(`Skills: .codex/skills`);
793
793
  console.log(`Next: sks selftest --mock; sks commands; sks dollar-commands`);
794
794
  if (!install.ok && install.scope === 'global') console.log('\nGlobal command missing. Run: npm i -g sneakoscope');
795
795
  if (!install.ok && install.scope === 'project') console.log('\nProject package missing. Run: npm i -D sneakoscope');
@@ -854,7 +854,7 @@ async function doctor(args) {
854
854
  sneakoscope: { ok: await exists(path.join(root, '.sneakoscope')) },
855
855
  db_guard: { ok: dbPolicyExists && dbScan.ok, policy: dbPolicyExists ? await loadDbSafetyPolicy(root) : null, scan: dbScan },
856
856
  hooks: { ok: await exists(path.join(root, '.codex', 'hooks.json')) },
857
- skills: { ok: (await exists(path.join(root, '.codex', 'skills'))) && (await exists(path.join(root, '.agents', 'skills'))) },
857
+ skills: { ok: await exists(path.join(root, '.codex', 'skills')) },
858
858
  codex_app: {
859
859
  ...codexApp,
860
860
  ok: codexApp.config.ok && codexApp.hooks.ok && codexApp.skills.ok && codexApp.agents.ok && codexApp.quick_reference.ok && codexApp.agents_rules.ok
@@ -873,7 +873,7 @@ async function doctor(args) {
873
873
  console.log(`DB Guard: ${result.db_guard.ok ? 'ok' : 'blocked'} ${dbScan.findings?.length || 0} finding(s)`);
874
874
  console.log(`Hooks: ${result.hooks.ok ? 'ok' : 'missing .codex/hooks.json'}`);
875
875
  console.log(`Codex App: ${result.codex_app.ok ? 'ok' : 'missing app files'} .codex/config.toml .codex/hooks.json .codex/skills .codex/agents .codex/SNEAKOSCOPE.md`);
876
- console.log(`Skills: ${result.skills.ok ? 'ok' : 'missing .codex/skills or .agents/skills'}`);
876
+ console.log(`Skills: ${result.skills.ok ? 'ok' : 'missing .codex/skills'}`);
877
877
  console.log(`Package: ${result.package.human}`);
878
878
  console.log(`Storage: ${storage.total_human || '0 B'}`);
879
879
  console.log(`Ready: ${result.ready ? 'yes' : 'no'}`);
@@ -1252,8 +1252,8 @@ async function selftest() {
1252
1252
  if (oldSksBin === undefined) delete process.env.SKS_BIN;
1253
1253
  else process.env.SKS_BIN = oldSksBin;
1254
1254
  }
1255
- const researchSkillExists = await exists(path.join(tmp, '.agents', 'skills', 'research-discovery', 'SKILL.md'));
1256
- if (!researchSkillExists) throw new Error('selftest failed: research skill not installed');
1255
+ const legacySkillMirrorExists = await exists(path.join(tmp, '.agents', 'skills', 'research-discovery', 'SKILL.md'));
1256
+ if (legacySkillMirrorExists) throw new Error('selftest failed: legacy .agents/skills mirror still installed');
1257
1257
  const codexAppSkillExists = await exists(path.join(tmp, '.codex', 'skills', 'research-discovery', 'SKILL.md'));
1258
1258
  if (!codexAppSkillExists) throw new Error('selftest failed: Codex App skill not installed');
1259
1259
  const dfSkillExists = await exists(path.join(tmp, '.codex', 'skills', 'DF', 'SKILL.md'));
@@ -1439,7 +1439,7 @@ async function projectWikiClaims(root) {
1439
1439
  const claims = [
1440
1440
  ['wiki-hooks', '.codex/hooks.json routes UserPromptSubmit, tool, permission, and Stop events through SKS guards.', '.codex/hooks.json', 'code', 'high'],
1441
1441
  ['wiki-config', '.codex/config.toml enables Codex App profiles, multi-agent support, and Team agent limits.', '.codex/config.toml', 'code', 'high'],
1442
- ['wiki-skills', '.codex/skills and .agents/skills provide local routes for DF, Team, Ralph, Research, AutoResearch, DB, GX, wiki, and evaluation workflows.', '.codex/skills', 'code', 'medium'],
1442
+ ['wiki-skills', '.codex/skills provides local routes for DF, Team, Ralph, Research, AutoResearch, DB, GX, wiki, and evaluation workflows.', '.codex/skills', 'code', 'medium'],
1443
1443
  ['wiki-agents', '.codex/agents defines Team planning, implementation, DB safety, and QA reviewer roles.', '.codex/agents', 'code', 'medium'],
1444
1444
  ['wiki-policy', '.sneakoscope/policy.json stores update-check, honest-mode, retention, database, performance, and prompt-pipeline policy.', '.sneakoscope/policy.json', 'contract', 'high'],
1445
1445
  ['wiki-memory', '.sneakoscope/memory stores Q0 raw, Q1 evidence, Q2 facts, Q3 tags, and Q4 control bits for hydratable context.', '.sneakoscope/memory', 'wiki', 'high'],
@@ -38,7 +38,7 @@ export function defaultEvaluationScenario() {
38
38
  ['req-wiki-rgba', 'TriWiki stores RGBA-derived trigonometric wiki anchors so compressed context remains hydratable by id, hash, source, and coordinate.', 'code', 'high', 1.2],
39
39
  ['req-retention', 'runtime logs and mission artifacts are bounded through retention policy and sks gc.', 'code', 'medium', 0.85],
40
40
  ['req-selftest', 'selftest covers contract sealing, DB guard blocking, done-gate evaluation, GX render/validate/drift, snapshot, and retention report.', 'test', 'high', 1.1],
41
- ['req-skill', 'sks init installs local skills under .agents/skills so project workflows can trigger domain-specific guidance.', 'code', 'medium', 0.9],
41
+ ['req-skill', 'sks init installs one canonical local skill set under .codex/skills so project workflows can trigger domain-specific guidance without duplicate commands.', 'code', 'medium', 0.9],
42
42
  ['req-design', 'design artifact work should gather design context, build an HTML artifact, expose variations when useful, and verify rendered output.', 'code', 'medium', 0.8]
43
43
  ];
44
44
  const noise = [
package/src/core/fsx.mjs CHANGED
@@ -5,7 +5,7 @@ import os from 'node:os';
5
5
  import crypto from 'node:crypto';
6
6
  import { spawn } from 'node:child_process';
7
7
 
8
- export const PACKAGE_VERSION = '0.6.7';
8
+ export const PACKAGE_VERSION = '0.6.9';
9
9
  export const DEFAULT_PROCESS_TAIL_BYTES = 256 * 1024;
10
10
  export const DEFAULT_PROCESS_TIMEOUT_MS = 30 * 60 * 1000;
11
11
 
package/src/core/init.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import path from 'node:path';
2
+ import fsp from 'node:fs/promises';
2
3
  import { ensureDir, readJson, readText, writeJsonAtomic, writeTextAtomic, mergeManagedBlock, nowIso, PACKAGE_VERSION, exists } from './fsx.mjs';
3
4
  import { DEFAULT_RETENTION_POLICY } from './retention.mjs';
4
5
  import { DEFAULT_DB_SAFETY_POLICY } from './db-safety.mjs';
@@ -102,7 +103,7 @@ export async function initProject(root, opts = {}) {
102
103
  const hookCommandPrefix = opts.hookCommandPrefix || sksCommandPrefix(installScope, { globalCommand: opts.globalCommand });
103
104
  const sine = path.join(root, '.sneakoscope');
104
105
  const dirs = [
105
- '.sneakoscope/state', '.sneakoscope/missions', '.sneakoscope/db', '.sneakoscope/bus', '.sneakoscope/hproof', '.sneakoscope/db', '.sneakoscope/wiki', '.sneakoscope/memory/q0_raw', '.sneakoscope/memory/q1_evidence', '.sneakoscope/memory/q2_facts', '.sneakoscope/memory/q3_tags', '.sneakoscope/memory/q4_bits', '.sneakoscope/gx/cartridges', '.sneakoscope/model/fingerprints', '.sneakoscope/genome/candidates', '.sneakoscope/trajectories/raw', '.sneakoscope/locks', '.sneakoscope/tmp', '.sneakoscope/arenas', '.sneakoscope/reports', '.codex', '.codex/skills', '.codex/agents', '.agents/skills'
106
+ '.sneakoscope/state', '.sneakoscope/missions', '.sneakoscope/db', '.sneakoscope/bus', '.sneakoscope/hproof', '.sneakoscope/db', '.sneakoscope/wiki', '.sneakoscope/memory/q0_raw', '.sneakoscope/memory/q1_evidence', '.sneakoscope/memory/q2_facts', '.sneakoscope/memory/q3_tags', '.sneakoscope/memory/q4_bits', '.sneakoscope/gx/cartridges', '.sneakoscope/model/fingerprints', '.sneakoscope/genome/candidates', '.sneakoscope/trajectories/raw', '.sneakoscope/locks', '.sneakoscope/tmp', '.sneakoscope/arenas', '.sneakoscope/reports', '.codex', '.codex/skills', '.codex/agents'
106
107
  ];
107
108
  for (const d of dirs) await ensureDir(path.join(root, d));
108
109
  const localExclude = localOnly ? await ensureLocalOnlyGitExclude(root) : null;
@@ -288,9 +289,9 @@ export async function initProject(root, opts = {}) {
288
289
  });
289
290
  created.push(`.codex/hooks.json (${installScope})`);
290
291
 
291
- await installSkills(root);
292
+ const skillInstall = await installSkills(root);
292
293
  created.push('.codex/skills/*');
293
- created.push('.agents/skills/*');
294
+ if (skillInstall.removed_legacy_agent_skill_dirs.length) created.push(`.agents/skills legacy mirrors removed (${skillInstall.removed_legacy_agent_skill_dirs.length})`);
294
295
  await installCodexAgents(root);
295
296
  created.push('.codex/agents/*');
296
297
  return { created };
@@ -435,12 +436,44 @@ async function installSkills(root) {
435
436
  'design-artifact-expert': `---\nname: design-artifact-expert\ndescription: Create or revise high-fidelity HTML, UI, prototype, deck-like, or visual design artifacts using project design context, variations, and rendered verification.\n---\n\nUse when the user asks for design, UI, prototype, HTML artifact, landing page, deck-like visual work, interaction design, or visual refinement.\n\nWorkflow:\n1. Understand the artifact, audience, constraints, fidelity, variants, and existing brand/design system.\n2. Inspect local code, assets, screenshots, or design-system docs before inventing visuals. If context exists, follow its visual vocabulary.\n3. Build the actual usable screen or artifact first; avoid empty landing-page framing unless the task is explicitly marketing.\n4. Use descriptive HTML filenames. Keep large artifacts split into small support files when needed.\n5. For screens/slides, add data-screen-label attributes for comment context. Slide labels are 1-indexed.\n6. Preserve state for decks, videos, or multi-step prototypes with localStorage when refresh continuity matters.\n7. Expose a small Tweaks surface for useful variants such as layout, density, color, copy, or interaction options.\n8. Verify the artifact renders cleanly in a browser or preview. For design tasks, set done-gate.json design_verification_required/present fields and cite evidence.\n\nQuality bar:\n- Root design decisions in available assets and components.\n- Use restrained, domain-appropriate layout and typography.\n- Avoid text overlap, unreadable controls, decorative clutter, one-note palettes, and placeholder-only deliverables.\n- Prefer icons and familiar controls for tool actions, and make repeated UI dimensions stable.\n`
436
437
  };
437
438
  for (const [name, content] of Object.entries(skills)) {
438
- for (const base of ['.codex/skills', '.agents/skills']) {
439
- const dir = path.join(root, base, name);
440
- await ensureDir(dir);
441
- await writeTextAtomic(path.join(dir, 'SKILL.md'), `${content.trim()}\n`);
442
- }
439
+ const dir = path.join(root, '.codex', 'skills', name);
440
+ await ensureDir(dir);
441
+ await writeTextAtomic(path.join(dir, 'SKILL.md'), `${content.trim()}\n`);
443
442
  }
443
+ return { removed_legacy_agent_skill_dirs: await removeLegacyAgentSkillMirrors(root, Object.keys(skills)) };
444
+ }
445
+
446
+ async function removeLegacyAgentSkillMirrors(root, skillNames) {
447
+ const legacyRoot = path.join(root, '.agents', 'skills');
448
+ if (!(await exists(legacyRoot))) return [];
449
+ const removed = [];
450
+ for (const name of skillNames) {
451
+ const dir = path.join(legacyRoot, name);
452
+ const skillPath = path.join(dir, 'SKILL.md');
453
+ const text = await readText(skillPath, null);
454
+ if (!isGeneratedSksLegacySkill(text, name)) continue;
455
+ await fsp.rm(dir, { recursive: true, force: true });
456
+ removed.push(path.relative(root, dir));
457
+ }
458
+ await removeDirIfEmpty(legacyRoot);
459
+ await removeDirIfEmpty(path.join(root, '.agents'));
460
+ return removed;
461
+ }
462
+
463
+ function isGeneratedSksLegacySkill(text, name) {
464
+ if (typeof text !== 'string') return false;
465
+ return text.startsWith('---') && new RegExp(`^name:\\s*${escapeRegExp(name)}\\s*$`, 'm').test(text);
466
+ }
467
+
468
+ function escapeRegExp(value) {
469
+ return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
470
+ }
471
+
472
+ async function removeDirIfEmpty(dir) {
473
+ try {
474
+ const entries = await fsp.readdir(dir);
475
+ if (!entries.length) await fsp.rmdir(dir);
476
+ } catch {}
444
477
  }
445
478
 
446
479
  async function installCodexAgents(root) {