Skip to content

Runtime Truth ratchet and Think-on-Echo model seam#15

Merged
flyingrobots merged 13 commits into
mainfrom
cycle/runtime-truth-standards-audit
May 16, 2026
Merged

Runtime Truth ratchet and Think-on-Echo model seam#15
flyingrobots merged 13 commits into
mainfrom
cycle/runtime-truth-standards-audit

Conversation

@flyingrobots
Copy link
Copy Markdown
Owner

Summary

  • add a Runtime Truth ratchet wired into lint with a committed baseline
  • add the Think-on-Echo proof seam, local Echo/Wesley capability probe, and provisional Think memory contract
  • define the Think memory data model before the Echo runtime round trip and mark GraphQL as model-derived, not source truth
  • clarify sponsor labels as sponsored-user abstractions

Test plan

  • npm run test:fast
  • npm run echo:probe -- --json
  • git diff --check

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Review Change Stack

Warning

Rate limit exceeded

@flyingrobots has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 17 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b970a2b6-fbe9-4ed6-bbe0-57250cd04aaf

📥 Commits

Reviewing files that changed from the base of the PR and between b52e423 and 1621502.

📒 Files selected for processing (18)
  • CHANGELOG.md
  • contracts/think-memory.graphql
  • docs/BEARING.md
  • docs/INFRASTRUCTURE_DOCTRINE.md
  • docs/audit/2026-05-13_runtime-truth-code-standard.md
  • docs/design/0068-think-memory-data-model/think-memory-data-model.md
  • docs/design/0069-think-echo-integration-plan/think-echo-integration-plan.md
  • docs/method/backlog/asap/CORE_think-echo-contract-proof.md
  • docs/method/backlog/bad-code/SURFACE_macos-appstate-composition-root.md
  • docs/method/backlog/up-next/CORE_think-echo-phase-1-app-contract.md
  • docs/method/backlog/up-next/CORE_think-echo-phase-2-runtime-roundtrip.md
  • package.json
  • scripts/lint.mjs
  • scripts/runtime-truth-ratchet.mjs
  • scripts/think-echo-capability-probe.mjs
  • test/ports/ports.test.js
  • test/ports/think-echo-contract.test.js
  • test/ports/think-echo-model-doc.test.js

Walkthrough

This PR enshrines “Runtime Truth”: doctrine and PR guidance, a ratchet script with baseline and npm lint integration, typed domain errors applied across ports/store/minds, Think memory GraphQL contract and design docs, Echo capability probe, MCP service refactors (injectable factories, followthrough/no‑op behavior), policies, and tests.

Changes

Typed Error Classes and Usage Patterns

Layer / File(s) Summary
Error class definitions and port abstractions
src/errors.js, src/store/ports.js
New DependencyError and PortNotImplementedError extend ThinkError; abstract ports throw PortNotImplementedError rather than generic Error.
Store module error standardization
src/store/checkpoint-state.js, src/store/content-reader.js, src/store/model.js, src/store/checkpoint-product-read.js
Store modules now throw ValidationError, DependencyError, or NotFoundError for invalid input, missing dependencies, or missing nodes instead of generic Error/TypeError.
Domain module error standardization
src/minds.js
shaderForMind throws ValidationError for invalid shaderCount.
Error type tests
test/ports/ports.test.js, test/ports/content-reader.test.js, test/ports/model.test.js, test/ports/minds.test.js
Tests updated/added to assert typed error instances, messages, and port metadata.

Runtime Truth Ratcheting and Code‑Limit Enforcement

Layer / File(s) Summary
Ratchet script, baseline data, and npm integration
scripts/runtime-truth-ratchet.mjs, docs/audit/runtime-truth-ratchet-baseline.json, package.json
Adds runtime-truth-ratchet.mjs to run selected ESLint strict rules and scan for throw new Error/TypeError, produces deterministic snapshots, compares against committed baseline JSON, and is invoked by npm run lint.
Audit baseline document and ratchet backlog
docs/audit/2026-05-13_runtime-truth-code-standard.md, docs/method/backlog/bad-code/CORE_runtime-truth-standard-ratchet.md
Audit records measurements, findings (F1–F8), compliance anchors, and phased ratchet roadmap for enforcement and cleanup.

Think‑on‑Echo GraphQL Contract and Data Model

Layer / File(s) Summary
GraphQL schema and contract tests
contracts/think-memory.graphql, test/ports/think-echo-contract.test.js
Adds think-memory.graphql with @wes_op/@wes_footprint directives, enums, ThoughtContent, ThoughtProvenance, ThoughtCapture, ThoughtEntry, CaptureThoughtInput/Result, and inspectThought/captureThought operations; test asserts presence of required fragments.
Think‑memory data model specification
docs/design/0068-think-memory-data-model/think-memory-data-model.md, test/ports/think-echo-model-doc.test.js
Comprehensive design doc defines domain objects, diagrams (sequence/class/ER), Phase 2 minimums, and migration plan; test pins required doc fragments.
Echo capability probe script
scripts/think-echo-capability-probe.mjs
Probe for Echo repo/toolchain readiness: contract presence, cargo/generator availability, runtime/kernel/wasm-ABI files, generator output marker detection; emits JSON or human summary and non‑zero exit on insufficient readiness.
Think‑on‑Echo contract proof design and backlog
docs/design/0067-think-echo-contract-proof/..., backlog updates
Design/spec describes witness flow, probe command, non‑goals, and Phase mapping; backlog items updated to require data-model as source of truth before Phase 2.

MCP Services, Capture, Migration, and Policies

Layer / File(s) Summary
MCP service factories and capture followthrough
src/mcp/service.js, test/ports/mcp-service.test.js
captureThought and migrateThoughtGraph refactored into injectable factories; capture saves raw locally, waits bounded followthrough (3s) and returns deferred/no‑migration outcomes with warnings; migration returns frozen no‑op when not required; tests validate behaviors and dependency call sequences.
CLI capture migrate shortcut and policies
src/cli/commands/capture.js, src/policies.js
runMigrateGraph short‑circuits when migration not required using createNoopMigrationResult; capturePolicy removed and createPushPolicy added to apply per‑attempt timeouts + retry/backoff for backups.

Tests, changelog, and packaging

Layer / File(s) Summary
Tests and changelog
test/ports/*, CHANGELOG.md
Adds/updates tests for ports, content reader, minds, model, contract/doc pinning, MCP service; CHANGELOG Unreleased updated with Runtime Truth ratchet, Think‑on‑Echo proof seam, capture followthrough behavior, and migration no‑op note.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

"Hold me to the highest standards. No mercy." — Pedantically pleased.

🚀 From Error to Echo we climb the Runtime Truth,
Typed boundaries guard the builders' booth,
Ratchets measure what the code can sow,
While GraphQL whispers how the thoughts will flow. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.49% 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
Title check ✅ Passed The title accurately summarizes the two main objectives: adding a Runtime Truth ratchet and establishing the Think-on-Echo model seam, which align with the primary changes in the changeset.
Description check ✅ Passed The description is directly related to the changeset, outlining the four key accomplishments (ratchet baseline, proof seam, data model definition, sponsor label clarification) and providing a test plan that demonstrates verification effort.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cycle/runtime-truth-standards-audit

Copy link
Copy Markdown

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

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: 138ee36c9b

ℹ️ 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 package.json Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 14

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/method/backlog/up-next/CORE_think-echo-phase-2-runtime-roundtrip.md (1)

29-42: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix ordered-list numbering to satisfy markdownlint MD029.

Line 31 and Line 32 use 0. prefixes in a sequential ordered list, which violates MD029 (ol-prefix) and can fail lint gates.

Suggested diff
-0. Confirm `docs/design/0068-think-memory-data-model/think-memory-data-model.md`
+1. Confirm `docs/design/0068-think-memory-data-model/think-memory-data-model.md`
    is the source truth for the contract.
-0. Revise `contracts/think-memory.graphql` from that model.
-0. Run `npm run echo:probe -- --json` and require
+2. Revise `contracts/think-memory.graphql` from that model.
+3. Run `npm run echo:probe -- --json` and require
    `ready_enough_for_phase_2`.
-1. Build a `CaptureThought` input through generated or minimally generated
+4. Build a `CaptureThought` input through generated or minimally generated
    contract helpers.
-2. Dispatch the canonical intent through Echo.
-3. Receive admission evidence for the capture.
-4. Build an exact `InspectThought` observation by entry id or coordinate.
-5. Receive a `ReadingEnvelope` or equivalent Echo observation artifact.
-6. Verify the reading posture is complete.
-7. Decode the payload into a Think-owned `ThoughtEntry`.
-8. Assert that raw text and capture metadata survived the round trip.
+5. Dispatch the canonical intent through Echo.
+6. Receive admission evidence for the capture.
+7. Build an exact `InspectThought` observation by entry id or coordinate.
+8. Receive a `ReadingEnvelope` or equivalent Echo observation artifact.
+9. Verify the reading posture is complete.
+10. Decode the payload into a Think-owned `ThoughtEntry`.
+11. Assert that raw text and capture metadata survived the round trip.
🤖 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/method/backlog/up-next/CORE_think-echo-phase-2-runtime-roundtrip.md`
around lines 29 - 42, The ordered list uses mixed prefixes (`0.` then `1.`) and
trips markdownlint MD029; update the entire ordered list so all items use a
consistent ordered-list marker (e.g., change every numeric prefix to `1.`) for
the steps that reference docs/design/0068-think-memory-data-model,
contracts/think-memory.graphql, npm run echo:probe -- --json
(ready_enough_for_phase_2), and the steps mentioning CaptureThought,
InspectThought, ReadingEnvelope, and ThoughtEntry so the list marker style is
uniform and the linter passes.
🤖 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.

Inline comments:
In `@contracts/think-memory.graphql`:
- Around line 37-43: The CaptureThoughtInput GraphQL input must be updated to
match the Phase 2 data model: replace the flat text: String! with a nested
content object containing text and digest fields (e.g., content.text and
content.digest) and add a causalRef object with runtime, coordinate, and witness
fields (causalRef.runtime, causalRef.coordinate, causalRef.witness); update or
extend the CaptureProvenanceInput referenced by CaptureThoughtInput as needed so
the schema aligns with the pinned model checklist and the names
CaptureThoughtInput, content.*, and causalRef.* are used exactly as specified.
- Around line 45-52: Rename and reshape the ThoughtEntry type to match the
pinned model by replacing entryId with thoughtId and changing the flat fields
into the Phase 2 structure: remove text: String!, add content: ThoughtContent
(containing text and digest), add causalRef: CausalRef (with
runtime/coordinate/witness), and include the metadata field; ensure the type
signature uses ThoughtEntry and references ThoughtContent, CausalRef, and
metadata exactly as in the spec so Phase 2 proofs can be implemented against
these fields.
- Line 41: The capturedAt field currently uses String! which loses temporal type
safety; change the GraphQL schema to use a proper datetime scalar (e.g.,
DateTime! or a custom scalar like DateTimeScalar) for the capturedAt field(s)
(refer to capturedAt in the ThinkMemory type and the other occurrence noted),
add/import the scalar definition in the schema, and update any
resolvers/mappers/validation that parse or serialize capturedAt (e.g., schema
resolver map or serialization helpers) to use the chosen DateTime scalar
implementation so values are validated and serialized consistently.

In `@docs/audit/2026-05-13_runtime-truth-code-standard.md`:
- Around line 369-371: The Markdown heading "### F8. Swift adapter is closer to
hexagonal shape, but app state is a composition hotspot" is split across two
lines and violates MD022; join the heading into a single line starting with
"###" followed by the full text and add a blank line immediately after the
heading to separate it from the following content so the heading renders
correctly.

In `@docs/BEARING.md`:
- Line 19: Add a blank line after each Markdown heading that's currently
directly followed by content — specifically after "### 1. Think-on-Echo Runtime
Proof" and the other headings noted — to satisfy MD022; update the heading
blocks (the "### 1. Think-on-Echo Runtime Proof" heading and the two other
headings mentioned in the comment) so there is an empty line between the heading
and the next paragraph or list.

In `@docs/design/0068-think-memory-data-model/think-memory-data-model.md`:
- Around line 727-736: Resolve the open decision about thoughtId semantics
before Phase 2 schema revision: decide whether thoughtId will be content-derived
(e.g., via contentDigest), capture-event-derived (e.g., via captureId), or a
composite of both, and then update the provisional GraphQL schema and uniqueness
constraints accordingly (or explicitly document the chosen temporary contract
for Phase 2). Update any references to thoughtId, contentDigest, captureId,
actorId, writerId, and the schema-generation rules so the ID semantics,
uniqueness rules, and how they map to GraphQL IDs are unambiguous; if you choose
a temporary approach, add a clear migration note in the doc indicating the final
strategy may change and how consumers should handle the interim contract.
- Around line 187-199: The Phase 2 minimal schema shows a "source" field but the
full model defines provenance: ThoughtProvenance; clarify whether "source" is a
flattened alias of provenance (e.g., string or enum extracted from
ThoughtProvenance) or a separate field by updating the doc to state the mapping
explicitly: either replace "source" with "provenance" in the Phase 2 list or
describe that "source" is a simplified representation of ThoughtProvenance (and
list which provenance properties are included, e.g., origin, channel) so
consumers of ThoughtEntry know how to translate between the full model
(provenance: ThoughtProvenance) and the Phase 2 minimum.

In `@docs/INFRASTRUCTURE_DOCTRINE.md`:
- Line 278: The docs list the non-existent ESLint rule "no-floating-promises"
which won't be enforced; update the rule name to the namespaced variant used
elsewhere by replacing "no-floating-promises" with
"@typescript-eslint/no-floating-promises" so the floating-promise detection is
actually provided by `@typescript-eslint` and matches the other
`@typescript-eslint/`... entries (search for the string "no-floating-promises" and
the surrounding rules block to apply the change).

In `@docs/method/backlog/bad-code/SURFACE_macos-appstate-composition-root.md`:
- Around line 23-24: The acceptance sentence is ambiguous; change the wording in
SURFACE_macos-appstate-composition-root.md so it reads as an explicit, testable
requirement for CaptureAppState.swift: require that CaptureAppState.swift must
be no more than 250 lines OR, if it exceeds 250 lines, must be split so each
resulting file implements exactly one primary responsibility (define "primary
responsibility" as a single class/struct/actor or a small cohesive set of
closely related functions that together implement one feature/concern). Update
the file to replace the current phrase with this explicit rule and the brief
definition to remove ambiguity for implementation and review.

In `@scripts/runtime-truth-ratchet.mjs`:
- Around line 59-64: The run function uses spawnSync without a timeout which can
hang; add a timeout option (e.g., 30000 ms) to the spawnSync call and handle
timeout failures explicitly: after calling spawnSync in run, detect a timeout
via result.error.code === 'ETIMEDOUT' or result.signal (or result.error) and
surface a ratchet-specific failure (throw or return an Error with a clear
message like "Runtime truth ratchet: command timed out") while respecting the
existing allowFailure behavior; update the spawnSync invocation that currently
uses { cwd: repoRoot, encoding: 'utf8', maxBuffer: ... } to include the timeout
and add the timeout handling logic in run.
- Around line 126-146: collectGenericThrowFindings misses throws that span
multiple lines because it scans one line at a time; change it to read each file
as a single string and run the genericThrowPattern as a global/multiline regex
over the whole file so matches can span line breaks. In the updated
collectGenericThrowFindings, iterate RegExp.exec(fileText) (or
fileText.matchAll) for each file, ensure genericThrowPattern uses [\s\S] or the
/s flag to allow dot to match newlines, and for each match compute line and
column by counting newlines up to match.index (e.g., line = fileText.slice(0,
match.index).split('\n').length, column = match.index - lastNewlineIndex + 1)
before pushing the frozen finding (keep fields category, file, kind, line,
column, text) so compareFindings still works.

In `@scripts/think-echo-capability-probe.mjs`:
- Around line 150-166: The temp-directory cleanup can be skipped if runCommand
or readGeneratedMarkers throws; update runGeneratorUnchecked to allocate tempDir
via mkdtempSync as before but wrap the command+marker reading and result
construction in a try block and move rmSync(tempDir, { force: true, recursive:
true }) into a finally block so cleanup always runs; ensure the function still
returns the frozen object when successful and rethrows or returns the original
error/result semantics if an exception occurs.

In `@test/ports/ports.test.js`:
- Around line 28-32: The predicate isPortError currently only checks instanceof,
portName, and methodName; extend it to also assert the canonical error shape by
verifying error.code and error.message match the PortNotImplementedError
contract (e.g., compare to PortNotImplementedError.prototype.code and
PortNotImplementedError.prototype.message or the class's known static values) so
tests fail on regressions to code/message; update the isPortError function to
include these additional equality checks.

In `@test/ports/think-echo-contract.test.js`:
- Around line 7-16: The test's brittle string matching uses the
requiredFragments array; replace it with AST-based checks by parsing the schema
(e.g., using graphql's parse/buildSchema) and asserting structure: that a
Mutation type contains captureThought with CaptureThoughtInput and the
`@wes_op/`@wes_footprint directives, that a Query type contains inspectThought
with mindId/entryId args returning ThoughtEntry, and that ThoughtEntry type
exists; locate the requiredFragments variable and update the assertion logic to
traverse the parsed DocumentNode (or GraphQLSchema) to verify type names, field
names, argument names/types, and directives instead of exact string fragments.

---

Outside diff comments:
In `@docs/method/backlog/up-next/CORE_think-echo-phase-2-runtime-roundtrip.md`:
- Around line 29-42: The ordered list uses mixed prefixes (`0.` then `1.`) and
trips markdownlint MD029; update the entire ordered list so all items use a
consistent ordered-list marker (e.g., change every numeric prefix to `1.`) for
the steps that reference docs/design/0068-think-memory-data-model,
contracts/think-memory.graphql, npm run echo:probe -- --json
(ready_enough_for_phase_2), and the steps mentioning CaptureThought,
InspectThought, ReadingEnvelope, and ThoughtEntry so the list marker style is
uniform and the linter passes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f377a97c-3238-4eaf-a94b-11050f201f48

📥 Commits

Reviewing files that changed from the base of the PR and between aaee858 and 138ee36.

📒 Files selected for processing (38)
  • .github/PULL_REQUEST_TEMPLATE.md
  • contracts/think-memory.graphql
  • docs/BEARING.md
  • docs/INFRASTRUCTURE_DOCTRINE.md
  • docs/audit/2026-05-13_runtime-truth-code-standard.md
  • docs/audit/runtime-truth-ratchet-baseline.json
  • docs/design/0067-think-echo-contract-proof/think-echo-contract-proof.md
  • docs/design/0068-think-memory-data-model/think-memory-data-model.md
  • docs/design/README.md
  • docs/method/backlog/asap/CORE_think-echo-contract-proof.md
  • docs/method/backlog/bad-code/CORE_boundary-codec-cutover.md
  • docs/method/backlog/bad-code/CORE_hexagonal-store-boundary.md
  • docs/method/backlog/bad-code/CORE_mcp-service-dependency-injection.md
  • docs/method/backlog/bad-code/CORE_runtime-domain-model-cutover.md
  • docs/method/backlog/bad-code/CORE_runtime-truth-standard-ratchet.md
  • docs/method/backlog/bad-code/CORE_think-echo-toolchain-capability-probe.md
  • docs/method/backlog/bad-code/SURFACE_browse-tui-strict-limits.md
  • docs/method/backlog/bad-code/SURFACE_macos-appstate-composition-root.md
  • docs/method/backlog/up-next/CORE_think-echo-phase-0-direction-charter.md
  • docs/method/backlog/up-next/CORE_think-echo-phase-1-app-contract.md
  • docs/method/backlog/up-next/CORE_think-echo-phase-2-runtime-roundtrip.md
  • docs/method/backlog/up-next/CORE_think-memory-data-model.md
  • package.json
  • scripts/runtime-truth-ratchet.mjs
  • scripts/think-echo-capability-probe.mjs
  • src/errors.js
  • src/minds.js
  • src/store/checkpoint-product-read.js
  • src/store/checkpoint-state.js
  • src/store/content-reader.js
  • src/store/model.js
  • src/store/ports.js
  • test/ports/content-reader.test.js
  • test/ports/minds.test.js
  • test/ports/model.test.js
  • test/ports/ports.test.js
  • test/ports/think-echo-contract.test.js
  • test/ports/think-echo-model-doc.test.js

Comment thread contracts/think-memory.graphql Outdated
Comment thread contracts/think-memory.graphql Outdated
Comment thread contracts/think-memory.graphql
Comment thread docs/audit/2026-05-13_runtime-truth-code-standard.md Outdated
Comment thread docs/BEARING.md
Comment thread scripts/runtime-truth-ratchet.mjs
Comment thread scripts/runtime-truth-ratchet.mjs
Comment thread scripts/think-echo-capability-probe.mjs
Comment thread test/ports/ports.test.js
Comment thread test/ports/think-echo-contract.test.js Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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.

Inline comments:
In `@docs/method/backlog/up-next/CORE_think-echo-phase-1-app-contract.md`:
- Around line 20-21: Replace the incorrect phrase "source truth" with the
correct "source of truth" wherever it appears in the document (the two
occurrences currently present as shown in the diff), e.g., update the contract
wording in CORE_think-echo-phase-1-app-contract.md by finding the literal string
"source truth" and changing it to "source of truth" so both occurrences read
grammatically and unambiguously.

In `@docs/method/backlog/up-next/CORE_think-echo-phase-2-runtime-roundtrip.md`:
- Around line 29-35: The ordered list in
CORE_think-echo-phase-2-runtime-roundtrip.md uses repeated "0." markers which
triggers MD029; update the four list items to use a proper incremental sequence
("1.", "2.", "3.", "4.") so the lint rule passes. Specifically change the lines
referencing docs/design/0068-think-memory-data-model/think-memory-data-model.md,
docs/design/0069-think-echo-integration-plan/think-echo-integration-plan.md,
contracts/think-memory.graphql, and the npm run echo:probe -- --json /
ready_enough_for_phase_2 instruction to be numbered 1–4 in order. Ensure
spacing/indentation is unchanged so only the numeric prefixes are corrected.
- Line 30: Replace the incorrect phrase "source truth" with the correct phrase
"source of truth" wherever it appears in the document (search for the exact
string "source truth" and normalize all occurrences to "source of truth"),
ensuring consistent wording across the file including other changed lines that
used the same phrase.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d4e86d7c-9593-4aaa-8ada-ce250866356f

📥 Commits

Reviewing files that changed from the base of the PR and between 138ee36 and b52e423.

📒 Files selected for processing (17)
  • CHANGELOG.md
  • contracts/think-memory.graphql
  • docs/design/0067-think-echo-contract-proof/think-echo-contract-proof.md
  • docs/design/0069-think-echo-integration-plan/think-echo-integration-plan.md
  • docs/design/README.md
  • docs/method/backlog/asap/CORE_think-echo-contract-proof.md
  • docs/method/backlog/bad-code/CORE_large-mind-read-timeouts.md
  • docs/method/backlog/up-next/CORE_think-echo-integration-plan.md
  • docs/method/backlog/up-next/CORE_think-echo-phase-1-app-contract.md
  • docs/method/backlog/up-next/CORE_think-echo-phase-2-runtime-roundtrip.md
  • scripts/think-echo-capability-probe.mjs
  • src/cli/commands/capture.js
  • src/mcp/service.js
  • src/policies.js
  • test/ports/mcp-service.test.js
  • test/ports/think-echo-contract.test.js
  • test/ports/think-echo-integration-doc.test.js
💤 Files with no reviewable changes (1)
  • src/policies.js

Comment thread docs/method/backlog/up-next/CORE_think-echo-phase-1-app-contract.md Outdated
Comment thread docs/method/backlog/up-next/CORE_think-echo-phase-2-runtime-roundtrip.md Outdated
Comment thread docs/method/backlog/up-next/CORE_think-echo-phase-2-runtime-roundtrip.md Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 15, 2026
@flyingrobots
Copy link
Copy Markdown
Owner Author

Review Cleanup Summary

Issue Severity First reported Addressed by Regression coverage Outcome
Preserve npm run lint -- --fix / lint arg forwarding while keeping the runtime-truth ratchet in lint. P2 chatgpt-codex-connector in PRRC_kwDORt_5Xc7BfJqR 4e72709 npm run lint -- --fix-dry-run; npm run test:fast Resolved
Align GraphQL contract and contract tests with the pinned Think memory model, including DateTime, structured ThoughtContent, CausalRef, and structural schema assertions. P2 coderabbitai review threads on contracts/think-memory.graphql and test/ports/think-echo-contract.test.js 4e72709 node --test test/ports/think-echo-contract.test.js test/ports/ports.test.js; npm run echo:probe -- --json; npm run test:fast Resolved
Harden runtime-truth and Echo probe scripts: command timeout, multiline throw scanning, and temp-dir cleanup. P2 coderabbitai review threads on scripts/runtime-truth-ratchet.mjs and scripts/think-echo-capability-probe.mjs 4e72709 npm run lint; npm run test:fast Resolved
Clean markdown/documentation review findings: heading spacing, model ID semantics, provenance/source mapping, app-state acceptance wording, ordered-list numbering, and source of truth wording. P3 coderabbitai review threads across docs/backlog files 4e72709, 3a27ff4 npm run lint; npm run test:fast; git diff --check; rg -n "source truth" ... returned no matches Resolved

Current gate state: all review threads resolved, CodeRabbit approved, CI test (22) passed, and PR #15 reports a clean merge state.

@flyingrobots
Copy link
Copy Markdown
Owner Author

@codex second opinion requested. Code Lawyer self-audit found one remaining wording consistency defect after git diff origin/main...HEAD.

Issue Severity Source File(s) Evidence Proposed outcome
Ambiguous source truth shorthand remains in newly added Think-on-Echo contract/model docs; prior review fixed only backlog occurrences. P5 Nit Self-audit contracts/think-memory.graphql; docs/design/0068-think-memory-data-model/think-memory-data-model.md; docs/design/0069-think-echo-integration-plan/think-echo-integration-plan.md; docs/method/backlog/asap/CORE_think-echo-contract-proof.md rg -n -i "source truth" still reports changed PR files. Add deterministic docs regression coverage, normalize to source of truth, verify lint/tests, commit separately.

Copy link
Copy Markdown

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

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: 3a27ff4f95

ℹ️ 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 contracts/think-memory.graphql Outdated
@flyingrobots
Copy link
Copy Markdown
Owner Author

Code Lawyer Activity Summary

Issue Severity Source File Commit Regression coverage Outcome
Normalize remaining source truth shorthand to source of truth across Think-on-Echo contract/model/proof docs and pin it with deterministic docs regression coverage. P5 Self-audit + later Codex thread PRRT_kwDORt_5Xc6CU6KP contracts/think-memory.graphql; docs/design/0068-think-memory-data-model/think-memory-data-model.md; docs/design/0069-think-echo-integration-plan/think-echo-integration-plan.md; docs/method/backlog/asap/CORE_think-echo-contract-proof.md; test/ports/think-echo-model-doc.test.js 1621502 RED: node --test test/ports/think-echo-model-doc.test.js failed on source truth; GREEN/VERIFY: focused Echo doc tests, npm run lint, npm run test:fast, git diff --check, pre-push test:ports Resolved

Current known upstream gate after pushing 1621502: GitHub Actions test (22) is running; CodeRabbit is currently blocked by insufficient review credits/cooldown and must clear before the merge gate can open.

@flyingrobots
Copy link
Copy Markdown
Owner Author

Code Lawyer Gate Update

Latest head: 1621502

Gate Status Evidence
CI PASS GitHub Actions test (22) passed on run 25912891289.
CodeRabbit PASS Status context is success and latest CodeRabbit review is approved.
Review threads PASS All review threads are resolved, including the outdated Codex wording thread fixed by 1621502.
Local verification PASS Focused regression, npm run lint, npm run test:fast, git diff --check, and pre-push test:ports passed.
Strict approval count LOCKED CodeRabbit approved; Codex commented. This does not satisfy the literal >=2 approvals rule from the Code Lawyer gate.

@flyingrobots
Copy link
Copy Markdown
Owner Author

Code Lawyer Activity Summary

Issue Severity Source File Commit Outcome
No new actionable PR or self-audit issues found in this pass. N/A PR threads + self-audit N/A N/A No code changes required.

Evidence from this pass:

  • Lockdown clean; git fetch origin completed.
  • Full GraphQL review-thread query returned 0 unresolved threads.
  • git diff origin/main...HEAD audited against the current head 1621502.
  • Targeted drift probes found no source truth wording and no literal James/Codex sponsor misuse in the active Echo docs.
  • Local verification passed: focused Echo doc/schema tests, npm run lint, npm run test:fast, npm run echo:probe -- --json, and git diff --check.
  • Upstream checks pass: CodeRabbit and GitHub Actions test (22).

Gate remains locked only under the strict Code Lawyer approval-count rule: current latest reviews show CodeRabbit APPROVED and Codex COMMENTED, not two approvals.

@flyingrobots
Copy link
Copy Markdown
Owner Author

@codex review

Copy link
Copy Markdown

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

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: 1621502556

ℹ️ 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/mcp/service.js
const repoAlreadyExists = deps.hasGitRepo(repoDir);

await deps.ensureGitRepo(repoDir);
const entry = await deps.saveRawCapture(repoDir, thought, {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reinstate timeout for MCP raw capture writes

The new captureThought flow now awaits deps.saveRawCapture(...) directly before any timeout wrapper, so a stalled WARP/local-store write can block the MCP request indefinitely. In the previous implementation this path was wrapped by capturePolicy (10s timeout) specifically to prevent hung store operations from hanging capture. This regression affects production cases where disk or graph IO stalls: callers no longer get a deferred/saved response and the request can hang forever.

Useful? React with 👍 / 👎.

@flyingrobots flyingrobots merged commit 774ac32 into main May 16, 2026
2 checks passed
@flyingrobots flyingrobots deleted the cycle/runtime-truth-standards-audit branch May 16, 2026 04:33
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