Skip to content

feat(substrate): auto-run in Claude Code, harden prototype, slim package, pro docs#10

Merged
CodeWithJuber merged 2 commits into
masterfrom
feat/substrate-polish
Jul 5, 2026
Merged

feat(substrate): auto-run in Claude Code, harden prototype, slim package, pro docs#10
CodeWithJuber merged 2 commits into
masterfrom
feat/substrate-polish

Conversation

@CodeWithJuber

Copy link
Copy Markdown
Owner
  • Ambient auto-use: UserPromptSubmit hook injects the full substrate advisory
    (assumption gate + routing + blast radius + memory + verify) when it matters,
    silent otherwise. Load-only, fail-safe, never writes .forge/ from a hook.
  • Cross-tool auto-use: source/rules.json substrate section emits the run-before-
    risky-work rule into every tool config via forge init.
  • Security: drop pickle cache in impact_oracle world_model (RCE via caller-supplied
    cache_dir); JSON node-link only + cache_dir containment.
  • Package: stop publishing docs/cognitive-substrate (~2MB); remove redundant zips
    (source lives unzipped in research/). npm tarball ~2.3MB -> 282KB.
  • Perf: substrateCheck no longer recomputes the assumption assessment.
  • Docs: professional example-rich cognitive-substrate guide; README consolidated.

…age, pro docs

- Ambient auto-use: UserPromptSubmit hook injects the full substrate advisory
  (assumption gate + routing + blast radius + memory + verify) when it matters,
  silent otherwise. Load-only, fail-safe, never writes .forge/ from a hook.
- Cross-tool auto-use: source/rules.json substrate section emits the run-before-
  risky-work rule into every tool config via forge init.
- Security: drop pickle cache in impact_oracle world_model (RCE via caller-supplied
  cache_dir); JSON node-link only + cache_dir containment.
- Package: stop publishing docs/cognitive-substrate (~2MB); remove redundant zips
  (source lives unzipped in research/). npm tarball ~2.3MB -> 282KB.
- Perf: substrateCheck no longer recomputes the assumption assessment.
- Docs: professional example-rich cognitive-substrate guide; README consolidated.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e47df0c64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/substrate.js
Comment on lines +165 to +169
const worthSaying =
result.assumption.shouldAsk ||
result.impact.impactedFiles.length > 0 ||
result.minimality.warnings.length > 0 ||
["opus", "fable"].includes(result.route.key);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include unresolved references in the ambient advisory

In the Claude UserPromptSubmit flow I checked (cortex_hook_main.js calls substrateContext(substrateCheck(...))), a prompt that names a missing symbol/file can produce a nonempty clarify block while assumption.shouldAsk stays false; if there is no impact/minimality/premium signal, this predicate returns "" and the hook emits nothing. The previous hook emitted clarifyBlock, so clear tasks that name nonexistent code now silently bypass the repo-grounding warning; include the unresolved preflight/result.clarify signal in this predicate/output.

Useful? React with 👍 / 👎.

Comment on lines +50 to +53
if os.path.commonpath([resolved, self.root]) != self.root:
raise ValueError(
f"cache_dir {cache_dir!r} must be inside root {self.root!r}"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep documented prototype caches working

The documented prototype entry points still construct WorldModel with /tmp/impact_oracle_demo_cache and /tmp/impact_oracle_eval_cache, which are outside the demo_package root. With this new containment check, python demo.py and evaluate.py raise ValueError before building the world model, so the shipped reproducibility commands break unless those callers are updated to use an in-root cache or a safe external-temp exception is preserved.

Useful? React with 👍 / 👎.

CI's floating @biomejs/biome ^2.0.0 resolved to 2.5.2 while biome.json's schema
stayed 2.0.0 — the mismatch hard-failed `biome check`. Pin the exact version
(matches the repo's pinning ethos) and bump the schema URL to 2.5.2; reformat.
@CodeWithJuber
CodeWithJuber merged commit 45030f0 into master Jul 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant