Skip to content

feat(SUP-3240): harden secondbrain capture determinism - #87

Merged
levineam merged 1 commit into
mainfrom
codex/SUP-3240-secondbrain-determinism
Jun 23, 2026
Merged

feat(SUP-3240): harden secondbrain capture determinism#87
levineam merged 1 commit into
mainfrom
codex/SUP-3240-secondbrain-determinism

Conversation

@levineam

@levineam levineam commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

This PR hardens the jarvOS secondbrain capture lane around AI coding tools only: OpenClaw, Codex, Claude Code, Hermes, and future coding adapters. It removes general chat apps from the active CaptureEvent source enum/current-target docs, adds a first-class Hermes session adapter, and documents OpenClaw-derived deterministic behavior as a jarvOS-owned public contract.

What Changed

  • Added CODING_TOOL_SOURCE_TOOLS for the active deterministic capture source list.
  • Removed general chat app names from active source validation and current-target secondbrain docs.
  • Added createHermesSessionAdapter() and session-source coverage.
  • Added docs/contracts/CODING_TOOL_DETERMINISM.md.
  • Updated Codex, Claude Code, Hermes, and OpenClaw runtime docs/templates to call shared jarvOS capture paths.
  • Added static drift smoke coverage for source constants, docs, and runtime instructions.
  • Staged this as the v0.6.2 unreleased patch candidate.

Review Process Evidence

No mandatory human review is required by policy for this change. The sufficient review process here is: branch diff sanity, targeted behavior tests, full secondbrain package tests, release candidate check, release drift check, and scoped wording/capitalization scans.

Verification

  • node --test modules/jarvos-secondbrain/tests/coding-tool-determinism-docs.test.js modules/jarvos-secondbrain/tests/session-source-adapters.test.js modules/jarvos-secondbrain/tests/universal-capture.test.js -> 14/14 passing
  • node --test modules/jarvos-secondbrain/packages/jarvos-ambient/test/intent-exports.test.js -> 16/16 passing
  • cd modules/jarvos-secondbrain && npm test -> 171/171 passing
  • npm run release:check:candidate -> READY v0.6.2
  • npm run release:drift -> OK (prep)
  • Scoped scans for general chat app target wording and jarVOS capitalization drift in current secondbrain/runtime surfaces returned no matches.

Scope Notes

  • This does not add automatic ingestion of every AI conversation.
  • This does not make general chat apps active first-class capture targets.
  • The compatibility note/journal contract remains available while runtime adapters move toward jarvos-capture.

Refs SUP-3240.

Summary by CodeRabbit

  • New Features

    • Added support for Hermes as a first-class AI coding-tool source.
    • Established determinism contract for AI coding-tool capture with standardized requirements across all supported tools.
  • Documentation

    • Updated v0.6.2 release notes and version policy.
    • Refined architecture documentation to clarify supported coding-tool sources and capture routes.
    • Updated all coding-tool runtime documentation with consistent capture instructions and expected outcomes.
  • Tests

    • Added test suite validating coding-tool determinism contracts and documentation alignment.
  • Chores

    • Bumped version to v0.6.2.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

jarvOS v0.6.2 adds a first-class Hermes session source adapter, introduces a CODING_TOOL_SOURCE_TOOLS constant that narrows SOURCE_TOOLS to coding-only tools (removing chatgpt and claude-app), adds a CODING_TOOL_DETERMINISM contract document and a four-test drift smoke suite, and aligns runtime docs/templates for Claude, Codex, Hermes, and OpenClaw to the shared jarvos-capture entrypoint with canonical journal/provenance invariants.

Changes

jarvOS v0.6.2 — Coding-Tool Capture Determinism

Layer / File(s) Summary
Capture contract: CODING_TOOL_SOURCE_TOOLS + Hermes in TOOL_SOURCE
modules/jarvos-secondbrain/packages/jarvos-ambient/src/intent/capture-contract.js, modules/jarvos-secondbrain/adapters/session-source/session-source-adapter.js, modules/jarvos-secondbrain/packages/jarvos-ambient/test/intent-exports.test.js
Introduces CODING_TOOL_SOURCE_TOOLS (['openclaw','codex','claude-code','hermes']) and derives SOURCE_TOOLS from it, removing chatgpt and claude-app. Adds hermes: 'hermes' to TOOL_SOURCE. Updates the validation-error assertion to match the revised allowed-tool list.
Hermes session source adapter
modules/jarvos-secondbrain/adapters/hermes/index.js, modules/jarvos-secondbrain/adapters/index.js, modules/jarvos-secondbrain/tests/session-source-adapters.test.js, modules/jarvos-secondbrain/tests/universal-capture.test.js
Adds createHermesSessionAdapter as a thin wrapper over createSessionSourceAdapter('hermes'), wires it into the adapter index, and verifies normalizeSession emits one source-backed CaptureEvent v2 event with expected id and text.
CODING_TOOL_DETERMINISM contract + drift smoke tests
modules/jarvos-secondbrain/docs/contracts/CODING_TOOL_DETERMINISM.md, modules/jarvos-secondbrain/tests/coding-tool-determinism-docs.test.js
Defines the determinism contract (supported tools, required capture entrypoint, note/journal invariants, non-ingestion boundaries). Adds four drift smoke tests: CODING_TOOL_SOURCE_TOOLS membership, banned chat-app identifiers in secondbrain docs, required semantic markers in the contract doc, and per-runtime doc capture-path invariant checks.
Runtime docs/templates aligned to shared capture contract
runtimes/claude/README.md, runtimes/claude/templates/CLAUDE.md.template, runtimes/codex/README.md, runtimes/hermes/skills/jarvos/SKILL.md, runtimes/openclaw/README.md
Adds a "Secondbrain Capture Rule" section to each runtime, specifying the jarvos-capture entrypoint, Notes/ directory target, single Journal/YYYY-MM-DD.md backlink, provenance preservation, pending-refresh freshness, and prohibition on guessed journal file creation.
Internal bridge/architecture docs and README narrowing
modules/jarvos-secondbrain/README.md, modules/jarvos-secondbrain/bridge/capture/README.md, modules/jarvos-secondbrain/bridge/provenance/README.md, modules/jarvos-secondbrain/bridge/routing/README.md, modules/jarvos-secondbrain/docs/architecture/automatic-secondbrain-public-boundary.md, modules/jarvos-secondbrain/docs/contracts/SESSION_SOURCE_ADAPTERS.md, modules/jarvos-secondbrain/packages/jarvos-secondbrain-notes/README.md
Narrows caller scope descriptions from "AI agent" to "AI coding tool", removes ChatGPT references, adds Hermes to session adapter stack and public boundary lists, and adds a "Coding-tool capture role" section to provenance README.
Version bump, CHANGELOG, release notes
package.json, CHANGELOG.md, docs/releases/v0.6.2.md, docs/release-process.md
Bumps version to 0.6.2, adds unreleased CHANGELOG entry, creates v0.6.2.md release notes with verification checklist, and updates release-process lanes from v0.3.0 to v0.6.x with refreshed Paperclip intake guidance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • levineam/jarvOS#44: Bootstraps and materializes CLAUDE.md from the same runtimes/claude/templates/CLAUDE.md.template that this PR extends with the "Secondbrain Capture Rule" section.
  • levineam/jarvOS#84: Lays the CaptureEvent v2 and session source adapter foundation in capture-contract.js that this PR modifies to add CODING_TOOL_SOURCE_TOOLS and remove chatgpt/claude-app.
  • levineam/jarvOS#54: Adds the v0.3 Paperclip intake lanes to docs/release-process.md that this PR replaces with the current v0.6.x lanes.

Poem

🐇 A hop, a skip, a hermes key,
No ChatGPT here — just coding-tool glee!
jarvos-capture guards each note with care,
One journal backlink, provenance laid bare.
The drift smoke sniffs for strays astray,
Deterministic bunnies win the day! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(SUP-3240): harden secondbrain capture determinism' clearly and specifically describes the main change—hardening capture determinism for the secondbrain system, which is the core objective of this PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/SUP-3240-secondbrain-determinism

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@levineam
levineam marked this pull request as ready for review June 23, 2026 01:20

@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: 57a0b3d2cf

ℹ️ 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".

For these requests, the coding tool must call the shared jarvOS entrypoint:

```bash
node modules/jarvos-secondbrain/scripts/jarvos-capture.js

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 Provide CaptureEvent input in the capture command

When a coding runtime follows this new contract literally, the documented node modules/jarvos-secondbrain/scripts/jarvos-capture.js invocation has no JSON on stdin even though jarvos-capture.js reads the CaptureEvent from stdin. In non-interactive execution this exits with validation errors like missing text/content, and in an interactive shell it can just wait for input, so intentional captures will not write the note or journal entry; the canonical contract should show the piped JSON/input shape here since the runtime docs/templates repeat this bare command.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
docs/release-process.md (1)

10-11: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor grammar improvement: use hyphen for compound adjective.

"v0.6.0 focused release" should be "v0.6.0-focused release" to correctly connect the version modifier to the noun.

✏️ Proposed fix
- `v0.6.x` is the current secondbrain hardening lane after the v0.6.0 focused
-  release and v0.6.1 capitalization patch.
+ `v0.6.x` is the current secondbrain hardening lane after the v0.6.0-focused
+  release and v0.6.1 capitalization patch.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/release-process.md` around lines 10 - 11, In the release-process.md
file, fix the compound adjective grammar by adding a hyphen between the version
number and the adjective. Change "v0.6.0 focused release" to "v0.6.0-focused
release" to properly connect the version modifier to the noun it describes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/release-process.md`:
- Around line 10-11: In the release-process.md file, fix the compound adjective
grammar by adding a hyphen between the version number and the adjective. Change
"v0.6.0 focused release" to "v0.6.0-focused release" to properly connect the
version modifier to the noun it describes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac101687-71fb-40da-a609-5303845c87e6

📥 Commits

Reviewing files that changed from the base of the PR and between 777aea9 and 57a0b3d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (25)
  • CHANGELOG.md
  • docs/release-process.md
  • docs/releases/v0.6.2.md
  • modules/jarvos-secondbrain/README.md
  • modules/jarvos-secondbrain/adapters/hermes/index.js
  • modules/jarvos-secondbrain/adapters/index.js
  • modules/jarvos-secondbrain/adapters/session-source/session-source-adapter.js
  • modules/jarvos-secondbrain/bridge/capture/README.md
  • modules/jarvos-secondbrain/bridge/provenance/README.md
  • modules/jarvos-secondbrain/bridge/routing/README.md
  • modules/jarvos-secondbrain/docs/architecture/automatic-secondbrain-public-boundary.md
  • modules/jarvos-secondbrain/docs/contracts/CODING_TOOL_DETERMINISM.md
  • modules/jarvos-secondbrain/docs/contracts/SESSION_SOURCE_ADAPTERS.md
  • modules/jarvos-secondbrain/packages/jarvos-ambient/src/intent/capture-contract.js
  • modules/jarvos-secondbrain/packages/jarvos-ambient/test/intent-exports.test.js
  • modules/jarvos-secondbrain/packages/jarvos-secondbrain-notes/README.md
  • modules/jarvos-secondbrain/tests/coding-tool-determinism-docs.test.js
  • modules/jarvos-secondbrain/tests/session-source-adapters.test.js
  • modules/jarvos-secondbrain/tests/universal-capture.test.js
  • package.json
  • runtimes/claude/README.md
  • runtimes/claude/templates/CLAUDE.md.template
  • runtimes/codex/README.md
  • runtimes/hermes/skills/jarvos/SKILL.md
  • runtimes/openclaw/README.md

@levineam
levineam merged commit 9ff96a2 into main Jun 23, 2026
7 checks passed
@levineam
levineam deleted the codex/SUP-3240-secondbrain-determinism branch June 23, 2026 14:43
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