Skip to content

docs: fix the claims the cold read of #377 found in its files - #447

Merged
jddunn merged 7 commits into
masterfrom
docs/audit-followups-14-fixes
Oct 14, 2026
Merged

jddunn merged 7 commits into
masterfrom
docs/audit-followups-14-fixes

Conversation

@jddunn

@jddunn jddunn commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

A cold read of #377 (merged as 0a7da7dd) checked its twelve items against the code, and each holds. It also found claims that #377 left false or misleading in the files it changed, and more in src/api/agency.ts once that file was open for item 2. This pull request fixes them. Each was read again at master f7e7548c (0.13.116), and the lines below are at the branch head.

  1. docs/architecture/ARCHITECTURE.md:385, :394, :644, :653: openness also scales schema encoding. The page said six of the eight mechanisms take a HEXACO trait and gave schema encoding no modulator. applyPersonalityModulation() scales schemaEncoding.noveltyBoost by 0.8 + openness * 0.4 (src/cognition/memory/mechanisms/CognitiveMechanismsEngine.ts:114), and only temporalGist is passed through unscaled (:110). applySchemaEncoding() multiplies a novel trace's encoding strength by that boost (src/cognition/memory/mechanisms/consolidation/SchemaEncoding.ts:110), and CognitiveMemoryManager builds the engine with config.traits (src/cognition/memory/CognitiveMemoryManager.ts:365). The page now says seven of the eight, all but temporal gist, and the Openness rows name the larger boost for novel traces.
  2. docs/orchestration/AGENCY_API.md:133 and :627-634, docs/GMI.md:467, src/api/agency.ts:38-44: emergent.tier is not read, and agency() keeps no shared memory. The tier table said "agent" specialists last as long as the agency instance and "shared" ones persist across instances, and the other three places said only session-tier specialists reset between send() calls. Nothing reads emergent.tier (src/api/types.ts:335-342 says so; git grep finds no reader in src). compileHierarchical().execute() calls buildHierarchicalTools() on every run (src/api/runtime/strategies/hierarchical.ts:453-458), which starts from a copy of the configured roster (:180). A session's send() runs the strategy through wrappedExecute() again (src/api/agency.ts:704-713, :383), and so does a retry after a failed output validation (:380-383). A spawned specialist is gone in the next run, whatever the tier. No file under src/api uses AgencyMemoryManager, so the line that a session's shared memory resets described memory that does not exist. The example no longer sets tier, the table is now a paragraph, and the "Not yet" verdict in the scope table now reads "No".
  3. docs/features/CLI_REGISTRY.md:177-216: the custom bridge example is typed. The base class declares buildArgs(options: BridgeOptions, format: OutputFormat): string[], classifyError(error: any): CLISubprocessError and parseStreamEvent(raw: any, context?: StreamParseContext): StreamEvent | null (src/safety/sandbox/subprocess/CLISubprocessBridge.ts:141, :150, :163). A method in a derived class does not take its parameter types from the base class (microsoft/TypeScript#23911, open), and without a contextual type a property of an object literal gets the widened literal type (microsoft/TypeScript#10676), so the example's unannotated parseStreamEvent() returned objects whose type is string. That is not a StreamEvent (src/safety/sandbox/subprocess/types.ts:64-83), so the override did not type-check, and its parameters were implicit any under strict. The example now imports BridgeOptions, OutputFormat and StreamEvent from the @framers/agentos/sandbox/subprocess subpath, which exports them (src/safety/sandbox/subprocess/index.ts; package.json ./sandbox/subprocess), and declares each signature.
  4. README.md:232: only generateText() and streamText() take tools. The API Surfaces line gave all eight helpers native tool calling. tools is a GenerateTextOptions field (src/api/generateText.ts:423), which streamText() takes (src/api/streamText.ts:334). GenerateObjectOptions, StreamObjectOptions, GenerateImageOptions, GenerateVideoOptions, GenerateMusicOptions, PerformOCROptions and EmbedTextOptions have no tools field (generateObject.ts:119, streamObject.ts:49, generateImage.ts:190, generateVideo.ts:203, generateMusic.ts:209, performOCR.ts:50, embedText.ts:53).
  5. README.md: the forge demo GIF comes out of the README. Its frames show agent({ persona, emergent: { forge_tool, spawn_specialist }, memory: { cognitive, scope }, tool_tiers }) and a call to npc.chat(), labelled "Live AgentOS run". AgentOptions (src/api/agent.ts:126, over BaseAgentConfig at src/api/types.ts:1334) has no persona or tool_tiers key, EmergentConfig (types.ts:332) holds enabled, tier, judge and planner, MemoryConfig (types.ts:70) has no cognitive or scope, and Agent (agent.ts:519-574) has no chat(). The frames also say the forged tool and the spawned specialist persist, which item 2 shows they do not. The alt text described three HEXACO agents reviewing code, which is not in the frames. The caption said examples/emergent-hierarchical-spawning.mjs reproduces the GIF, but that example runs a hierarchical agency with two static agents (:29-51) that spawns specialists through spawn_specialist and calls no forge_tool. assets/agentos-forge-demo.gif and .webp stay in the repository, and nothing else in it references them.
  6. src/api/agency.ts: the comments on the guardrail, RAG, voice and usage paths.
    • runGuardrails() (:1180-1239): the JSDoc said each id goes through ParallelGuardrailDispatcher, a block throws AgencyConfigError, and sanitized text comes back. The function imports ../safety/guardrails/index.js, uses nothing from it (:1205-1207), reports each id to guardrailResult with passed: true, enforced: false and action: 'allow' (:1217), and returns the text unchanged. It never throws, and a failed import logs a warning (:1233-1236). The JSDoc and its inline comments now say so. prepareExecutionPrompt() and finalizeExecutionResult() call it for the input and output lists (:247, :277).
    • injectRagContext() and retrieveRagContext() (:1245-1300): the JSDoc said a configured vector store is queried through a dynamically imported embedding manager. retrieveRagContext() returns null (:1299), so the prompt is never changed. The notice for rag.documents (:1270-1277) named AgentOSOrchestrator for document indexing and retrieval; the runtime's RAG subsystem is set up by RagMemoryInitializer from AgentOSConfig.retrievalAugmentor or AgentOSConfig.ragConfig (src/api/AgentOS.ts:503, :523; src/api/runtime/RagMemoryInitializer.ts:241-257). The notice now says the documents go unused and names those two fields; src/api/runtime/__tests__/agency-integration.test.ts:1207-1230 pins the new text and that AgentOSOrchestrator is no longer named.
    • listen() (:852-868, :881-883): the JSDoc called the connection handler a no-op stub for audio I/O. The handler reads each message as JSON, sends a text field through the agency's generate() and replies { text }, and replies { error } when the parse or the run throws (:889-899). No audio is read.
    • The session's and the agency's usage() (:751-756, :772-777) were called stubs that need a usage ledger. Both return the totals the agency adds up in memory from each run's usage (:229-231, :290-292), and agency() writes no ledger.
    • The file header said the strategies never run all members in parallel; the parallel strategy runs every member at once (src/api/runtime/strategies/parallel.ts:106). It now says each generate() or send() answers one input.
    • The comment at :142-149 said the dispatcher wraps the chosen strategy when adaptive is set. agency() compiles 'hierarchical' itself (:153-155), and compileStrategy() wraps only a non-hierarchical strategy (src/api/runtime/strategies/index.ts:70), so the wrapper is never reached from agency(), as AGENCY_API.md's Adaptive Mode says.
    • The parseStructuredOutput() JSDoc sat above extractFirstJsonObject()'s and said "two" patterns before listing three. It now sits on its function (:1386-1400).
  7. src/api/runtime/lightweightAgentDiagnostics.ts:69-110: the agent() warning names agency() only where agency() applies the field. The warning said every deferred field "requires the full AgentOS runtime or agency()". agency() reports its guardrails as not evaluated (item 6), adds no RAG context (item 6), reads no discovery (no reference in agency.ts or strategies/), serves voice as JSON text (item 6) and wires no channels (connect() rejects, agency.ts:931). It applies hitl, emergent, output and provenance. The warning now names the full runtime alone for rag, discovery, guardrails, voice and channels, and the runtime or agency() for the other four. src/api/runtime/__tests__/agent.test.ts:83-99 pins both groups; the existing case at :50-65 still matches.

Checked and left as is. One review engine's P0 said the code-safety bullet (docs/architecture/ARCHITECTURE.md:357) leaves out an opt-in that its tool-call branch needs. @framers/agentos-ext-code-safety 0.2.2, the npm latest on 2026-10-14, sets evaluateToolCalls: true in its own config (src/CodeSafetyGuardrail.ts:147-151 in the tarball), and docs/safety/GUARDRAILS_USAGE.md:462 says the pack's guard runs its tool-call branch once its config sets the flag. The bullet stands.

Found and not changed here (wording, or files this does not touch):

  • docs/memory/COGNITIVE_MEMORY.md:25 calls all eight mechanisms HEXACO-modulated, but temporal gist is not (CognitiveMechanismsEngine.ts:110).
  • docs/architecture/EMERGENT_CAPABILITIES.md:16 says the screenshot's run of examples/emergent-hierarchical-spawning.mjs asked for a security audit of sandbox isolation primitives. The example's prompt asks for a survey of the post-2023 RAG literature (:85-89).
  • src/safety/sandbox/subprocess/CLISubprocessBridge.ts:119-124: the class JSDoc's example has the same untyped parseStreamEvent() as item 3.
  • src/api/gmi.ts:330: the gmi() warning says "does not enforce yet", also for security and permissions, which no surface enforces.
  • examples/emergent-hierarchical-spawning.mjs:54 and docs/orchestration/AGENCY_API.md:1205 put "discarded when generate() returns" on the tier: 'session' line. It is true of every tier.
  • src/api/agency.ts: the generate() JSDoc names its parameter opts (it is generateOpts), the unknown-id branch of evaluatePostApprovalGuardrail() says "until a registry resolver is wired", and the catch in injectRagContext() describes a failure retrieveRagContext() cannot raise.
  • scripts/build-knowledge-corpus.mjs (listed in docs: fourteenth round of audit follow-ups (the P2 leftovers of the cold reads) #377): the security-tier lines are unchanged.

Linked issues

None. The findings come from the cold read of #377.

Type of change

  • Bug fix
  • Feature
  • Performance
  • Documentation
  • Refactor
  • Tests
  • Build or CI

How this was verified

GitHub Actions on the head commit f0d5048e: CI run 38508916615 passed (Test & Lint: 905 test files and 11,663 tests passed, among them src/api/runtime/__tests__/agent.test.ts with 24 tests, the new case included, and src/api/runtime/__tests__/agency-integration.test.ts with 71; Browser tests; Batch-1 gated tests; Release dry run), Links run 38508916599 passed, and the Breaking change gate passed. The first four commits passed CI run 38507089907 as well.

Review threads: CodeRabbit reviewed b6770ce3 and posted no actionable comments; its review of the last three commits runs behind the merge. The Codex connector and Sourcery did not review (their usage limits).

Nothing was run locally. Every claim was read in the code at master f7e7548c, and item 5 also in frames from assets/agentos-forge-demo.gif at master. The code-safety check used the npm tarball of @framers/agentos-ext-code-safety 0.2.2. The two new GitHub links (hierarchical.ts, CLISubprocessBridge.ts) answered 200 on 2026-10-14. src/api/runtime/__tests__/docs-alignment.test.ts reads README.md and docs/GMI.md. Its assertions (generateImage, agent(), agency(), ## API Surfaces, fallbackProviders, lightweight, no plain agent() call with memory) still hold, and the CI step "Documentation states only what the code enforces" finds none of its words in the changed lines.

Migration notes

None. Two log lines change their text: the agent() warning for deferred fields (item 7) and the agency() notice for rag.documents (item 6). Code that matches the old text of either needs the new one. The squash commit is docs:, so semantic-release publishes nothing for it, and the two texts reach npm with the next feat or fix release.

Checklist

  • Tests cover the changed behavior.
  • Docs are updated.
  • The title follows Conventional Commits, with ! before the colon for a change that breaks users (feat!: or feat(api)!:).
  • No secrets or private data are included.
  • Every automated review thread is settled (how).
  • I have read this change and can explain every line.

CognitiveMechanismsEngine scales schemaEncoding.noveltyBoost by
0.8 + openness * 0.4, so seven of the eight mechanisms take a HEXACO
trait; only temporal gist is left unscaled.
The hierarchical strategy copies the configured roster at the start of
each run (buildHierarchicalTools), and nothing reads emergent.tier, so
the tier table's agent and shared lifetimes did not exist. agency()
also uses no AgencyMemoryManager, so a session has no shared memory to
reset.
Without a declared return type, parseStreamEvent() returned objects
whose type widened to string, which does not match StreamEvent, and its
parameters were implicit any under strict.
…orge demo GIF

The GIF shows agent() options and an npc.chat() method that the Agent
API does not have, labelled as a live run, and the example its caption
names runs a hierarchical agency with two static agents that forges no
tool. The assets stay in the repository.
@jddunn
jddunn requested a review from Victor-Evogor as a code owner October 14, 2026 03:36
@sourcery-ai

sourcery-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Sorry @jddunn, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 3 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai

sourcery-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Reviewer's Guide

This documentation-focused PR corrects five claims identified by a code-level cold read: cognitive-memory modulation, agency and specialist lifetimes, CLI bridge typing, tool support across low-level helpers, and the README forge-demo description. It updates prose, examples, type annotations, links, and an agency source comment without changing runtime behavior.

Sequence diagram for per-call specialist lifetime

sequenceDiagram
    participant Caller
    participant Agency
    participant Strategy
    participant Manager

    Caller->>Agency: send()
    Agency->>Strategy: wrappedExecute()
    Strategy->>Manager: buildHierarchicalTools()
    Manager-->>Strategy: configured roster copy
    Strategy->>Manager: spawn_specialist()
    Manager-->>Strategy: specialist available for this call
    Strategy-->>Agency: result
    Agency-->>Caller: response

    Caller->>Agency: send()
    Agency->>Strategy: wrappedExecute()
    Strategy->>Manager: buildHierarchicalTools()
    Manager-->>Strategy: configured roster copy without prior specialist
Loading

Flow diagram for HEXACO modulation of cognitive memory

flowchart LR
    Traits[CognitiveMemoryConfig.traits] --> Engine[CognitiveMemoryManager]
    Engine --> Modulation["applyPersonalityModulation()"]
    Modulation --> Boost[schemaEncoding.noveltyBoost]
    Boost --> Encoding["applySchemaEncoding()"]
    Encoding --> Trace[Novel trace encoding strength]
Loading

File-Level Changes

Change Details Files
Corrected the documented HEXACO modulation coverage for cognitive memory mechanisms.
  • Documented openness scaling of schema encoding and its stronger effect on novel traces.
  • Updated the mechanism count and identified temporal gist as the sole unmodulated mechanism.
docs/architecture/ARCHITECTURE.md
Aligned agency lifecycle and emergent-specialist documentation with the current runtime behavior.
  • Removed unsupported specialist lifetime claims and the unused tier example.
  • Documented that every agency call starts from the configured roster and that agency() has no shared memory.
  • Updated API, GMI, and source comments plus the scope verdict.
docs/orchestration/AGENCY_API.md
docs/GMI.md
src/api/agency.ts
Made the custom CLI bridge documentation compile under strict TypeScript typing.
  • Added exported type imports and explicit override parameter and return types.
  • Preserved literal StreamEvent discriminants through the declared return type.
docs/features/CLI_REGISTRY.md
Restricted the README API-surface claim to helpers that actually support native tools.
  • Specified that only generateText() and streamText() accept tools.
README.md
Removed an inaccurate forge-demo presentation from the README.
  • Deleted the GIF/WebP embed, misleading alt text, and reproduction caption.
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: framerslab/agentos/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 65eb26fa-3e42-4e35-afb3-e688fbd5022c
📥 Commits

Reviewing files that changed from the base of the PR and between b6770ce and f0d5048.

📒 Files selected for processing: 5
  • docs/orchestration/AGENCY_API.md
  • src/api/agency.ts
  • src/api/runtime/__tests__/agency-integration.test.ts
  • src/api/runtime/__tests__/agent.test.ts
  • src/api/runtime/lightweightAgentDiagnostics.ts
 __________________________________
< Jazz Jackrabbit is my alter ego. >
 ----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: framerslab/agentos/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: b1af4f6e-28c9-4bc8-9c4f-e644c4bdfa97
📥 Commits

Reviewing files that changed from the base of the PR and between 728d8ef and b6770ce.

📒 Files selected for processing: 6
  • README.md
  • docs/GMI.md
  • docs/architecture/ARCHITECTURE.md
  • docs/features/CLI_REGISTRY.md
  • docs/orchestration/AGENCY_API.md
  • src/api/agency.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

📝 Walkthrough

This pull request updates documentation for tool support, agency session and specialist lifetimes, HEXACO schema encoding, and typed CLI bridge examples. It also removes a demo block from the README.

Changes: README API descriptions

Layer / File(s) Summary
Demo and tool support descriptions
README.md
The README removes the demo image, caption, and reproduction command. It clarifies that generateText() and streamText() accept tools, while the other listed helpers do not.

Agency call lifetimes

Layer / File(s) Summary
Session state and specialist lifetimes
src/api/agency.ts, docs/orchestration/AGENCY_API.md, docs/GMI.md
The documentation distinguishes persistent session history and usage totals from non-persistent shared memory and spawned specialists. It states that spawned specialists are removed before the next call, regardless of emergent.tier.

HEXACO mechanism documentation

Layer / File(s) Summary
Openness and schema encoding
docs/architecture/ARCHITECTURE.md
The documentation states that openness scales schema encoding for novel traces. It identifies temporal gist extraction as the exception among eight mechanisms to HEXACO scaling.

CLI bridge example

Layer / File(s) Summary
Typed bridge functions
docs/features/CLI_REGISTRY.md
The custom bridge example adds type-only imports and annotations for buildArgs, classifyError, and parseStreamEvent. A comment notes that the return type preserves literal event types.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to b6770

The documentation corrections are ready to merge after normal checks.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Title check Passed The title clearly identifies a documentation change that fixes five inaccurate claims from the referenced pull request. It is concise and follows Conventional Commits syntax.
Description check Passed The description is complete and detailed. It includes the summary, linked issues, change type, verification details, migration notes, and checklist. The verification section is not empty, and the unch…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A failed output validation retries the strategy, and each run copies
the configured roster, so the specialist is gone in the retry as well as
in the next call.
runGuardrails() evaluates no guardrail and never throws; it reports each
id as not evaluated. retrieveRagContext() returns null, so no context is
added, and the rag.documents notice now says the documents go unused and
names the runtime's ragConfig and retrievalAugmentor in place of
AgentOSOrchestrator, which sets up no retrieval. listen() serves JSON
text, not audio. The usage totals are real in-memory sums, not stubs.
adaptive compiles the hierarchical strategy directly, and the parallel
strategy runs every member, so the header no longer says otherwise. The
parseStructuredOutput() JSDoc sits on its function and counts three
patterns.
…he full runtime alone

agency() reports its guardrails as not evaluated, retrieves no RAG
context, reads no discovery, serves voice as text and wires no
channels, so the warning names agency() only for hitl, emergent, output
and provenance.
@jddunn jddunn changed the title docs: fix five claims the cold read of #377 found in its files docs: fix the claims the cold read of #377 found in its files Oct 14, 2026
@jddunn
jddunn merged commit 798ffa2 into master Oct 14, 2026
10 of 11 checks passed
@jddunn
jddunn deleted the docs/audit-followups-14-fixes branch October 14, 2026 04:03
github-actions Bot pushed a commit that referenced this pull request Oct 14, 2026
## [0.13.118](v0.13.117...v0.13.118) (2026-10-14)

### feat

* **claims:** browser test reports as claim evidence (#449) ([ed46090](ed46090))

### docs

* correct the GMI paper's lines on persona traits and T4 contexts (#448) ([3fbc713](3fbc713))
* fix the claims the cold read of #377 found in its files (#447) ([798ffa2](798ffa2))
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