Skip to content

Incorporate internal research architecture into the open-source prototype - #2

Merged
cyharyanto merged 2 commits into
masterfrom
contrib/internal-research
May 24, 2026
Merged

cyharyanto merged 2 commits into
masterfrom
contrib/internal-research

Conversation

@cyharyanto

Copy link
Copy Markdown
Contributor
  • Pull cognition parsing out of the kernel by introducing strong-typed adapter outputs (ActionHint, DecisionLine, JudgeOutput), a shared runtime::canonicalize utility for cross-vendor canonicalization (markdown fences, prose-around-JSON, balanced-brace extraction), and renaming CognitionResponse.text → content with role-specific typed fields populated by adapters.
  • Give the Actor an agentic inner loop bounded by DEFAULT_INNER_STEP_BUDGET so pure-reasoning replies continue the turn while structured ActionHint responses commit, replacing the prior single-turn JSON-parse-or-fail surface.
  • Replace the findings-specific Tool with a generic record substrate by removing record_finding, renaming Finding/*FindingsBackend to Record/*RecordStore, routing record appends through modify_artifact with kind=record-store, and letting the Charter define record content shape while the kernel injects _* provenance.
  • Add the Skills primitive as Actor-side cognition instrumentation by adding core::skill::Skill (content-hashed, SKILL.md convention), folding skills into the Snapshot identity hash, loading them from <charter_dir>/skills/*.md, and composing them into the Actor system prompt under grounding.
  • Drop filesystem IO from the kernel by splitting charter_loader into pure parsers (parse_charter_def, parse_role_context_def) inside core/ and deployment-side IO (load_charter_def, load_role_context_def, load_skills) inside runtime::charter_loader.
  • Unify durable streams on one async append-only primitive by adding chartered_dispatch::JsonlSink serving Receipts, the cognition log, and the record store, making ReceiptStore::append async, and codifying the discipline in a new spec §Persistence.
  • Make Snapshots persisted and addressable by adding chartered_dispatch::snapshot_store (one immutable file per <chartered_dir>/snapshots/<id>.json), persisting on Snapshot creation, and adding spec §Snapshot Lifecycle so every Receipt's snapshot_id resolves to a record on disk.
  • Rework the v1 protocol by giving Receipt receipt_id/task_id/attempt_id/steward_id, replacing EnforcementLevel with structured GovernanceMode (grounding+evaluation toggles), promoting Verdict.frame_id to a Steward-scoped FrameRef, renaming ToolCall.tool_name → tool while dropping its timestamp, and removing Metrics.
  • Add the Gemini cognition backend as a sibling adapter to OpenAI by introducing runtime::gemini_backend with lazy per-model outputTokenLimit/thinking caching, native role mapping (System → systemInstruction, Assistant → model), and an explicit non-forwarding policy for LLM-native tools (search/codeExec/urlContext are cognition, not governed Tools).
  • Rename the OpenAI environment variables from LLM_* to OPEN_AI_* across .env, runtime, dashboard launcher, docs, and tests so per-vendor configuration is decoupled from the abstract LLM name now that Gemini exists alongside OpenAI.
  • Make the dashboard read its Charter view from the kernel by adding chartered-runtime --print-charter (JSON emit of the parsed Charter), replacing the dashboard's parallel TOML+markdown parser in local-api.mjs with a subprocess call, so the Charter parser has one source of truth.
  • Codify three-tier test discipline by formalizing unit (stateless, CI) / integration (vertical cut, tempdir-isolated, CI) / e2e (real LLM via production transport, local-only, #[ignore]d, no soft-skip) in AGENTS.md §Verification, adding docs/IMPLEMENTATION_CHECKLIST.md §Test Tier Discipline, renaming tests/e2e.rs → tests/binary_integration.rs, adding tests/persistence.rs, and gating llm_e2e.rs behind #[ignore].
  • Expand the specification to cover the newly-incorporated subsystems by adding §Persistence, §Snapshot Lifecycle, §Skills, §Subagents, §User-Facing Integration Boundary, the "Cognition is commodity" framing for §Cognition Layer, and the "LLM-side native tools are cognition, not Tools" clarification under §Tools.
  • Add Transcription Fidelity discipline to AGENTS.md requiring user-intent artifacts to contain only the user's stated words, prohibiting silent assistant extrapolation into mandates and briefs.

cyharyanto and others added 2 commits May 24, 2026 19:17
…type

- Pull cognition parsing out of the kernel by introducing strong-typed adapter outputs (`ActionHint`, `DecisionLine`, `JudgeOutput`), a shared `runtime::canonicalize` utility for cross-vendor canonicalization (markdown fences, prose-around-JSON, balanced-brace extraction), and renaming `CognitionResponse.text` → `content` with role-specific typed fields populated by adapters.
- Give the Actor an agentic inner loop bounded by `DEFAULT_INNER_STEP_BUDGET` so pure-reasoning replies continue the turn while structured `ActionHint` responses commit, replacing the prior single-turn JSON-parse-or-fail surface.
- Replace the findings-specific Tool with a generic record substrate by removing `record_finding`, renaming `Finding`/`*FindingsBackend` to `Record`/`*RecordStore`, routing record appends through `modify_artifact` with `kind=record-store`, and letting the Charter define record content shape while the kernel injects `_*` provenance.
- Add the Skills primitive as Actor-side cognition instrumentation by adding `core::skill::Skill` (content-hashed, SKILL.md convention), folding skills into the Snapshot identity hash, loading them from `<charter_dir>/skills/*.md`, and composing them into the Actor system prompt under grounding.
- Drop filesystem IO from the kernel by splitting `charter_loader` into pure parsers (`parse_charter_def`, `parse_role_context_def`) inside `core/` and deployment-side IO (`load_charter_def`, `load_role_context_def`, `load_skills`) inside `runtime::charter_loader`.
- Unify durable streams on one async append-only primitive by adding `chartered_dispatch::JsonlSink` serving Receipts, the cognition log, and the record store, making `ReceiptStore::append` async, and codifying the discipline in a new spec §Persistence.
- Make Snapshots persisted and addressable by adding `chartered_dispatch::snapshot_store` (one immutable file per `<chartered_dir>/snapshots/<id>.json`), persisting on Snapshot creation, and adding spec §Snapshot Lifecycle so every Receipt's `snapshot_id` resolves to a record on disk.
- Rework the v1 protocol by giving `Receipt` `receipt_id`/`task_id`/`attempt_id`/`steward_id`, replacing `EnforcementLevel` with structured `GovernanceMode` (grounding+evaluation toggles), promoting `Verdict.frame_id` to a Steward-scoped `FrameRef`, renaming `ToolCall.tool_name` → `tool` while dropping its timestamp, and removing `Metrics`.
- Add the Gemini cognition backend as a sibling adapter to OpenAI by introducing `runtime::gemini_backend` with lazy per-model `outputTokenLimit`/`thinking` caching, native role mapping (System → `systemInstruction`, Assistant → `model`), and an explicit non-forwarding policy for LLM-native tools (search/codeExec/urlContext are cognition, not governed Tools).
- Rename the OpenAI environment variables from `LLM_*` to `OPEN_AI_*` across `.env`, runtime, dashboard launcher, docs, and tests so per-vendor configuration is decoupled from the abstract LLM name now that Gemini exists alongside OpenAI.
- Make the dashboard read its Charter view from the kernel by adding `chartered-runtime --print-charter` (JSON emit of the parsed Charter), replacing the dashboard's parallel TOML+markdown parser in `local-api.mjs` with a subprocess call, so the Charter parser has one source of truth.
- Codify three-tier test discipline by formalizing unit (stateless, CI) / integration (vertical cut, tempdir-isolated, CI) / e2e (real LLM via production transport, local-only, `#[ignore]`d, no soft-skip) in `AGENTS.md §Verification`, adding `docs/IMPLEMENTATION_CHECKLIST.md §Test Tier Discipline`, renaming `tests/e2e.rs` → `tests/binary_integration.rs`, adding `tests/persistence.rs`, and gating `llm_e2e.rs` behind `#[ignore]`.
- Expand the specification to cover the newly-incorporated subsystems by adding §Persistence, §Snapshot Lifecycle, §Skills, §Subagents, §User-Facing Integration Boundary, the "Cognition is commodity" framing for §Cognition Layer, and the "LLM-side native tools are cognition, not Tools" clarification under §Tools.
- Add Transcription Fidelity discipline to `AGENTS.md` requiring user-intent artifacts to contain only the user's stated words, prohibiting silent assistant extrapolation into mandates and briefs.
chartered-tracer depends on libseccomp, whose libseccomp-sys build
script emits an unconditional `cargo:rustc-link-lib=dylib=seccomp`.
The ubuntu-latest runner does not ship libseccomp.so, so the linker
fails with `unable to find library -lseccomp`. Install libseccomp-dev
alongside protobuf-compiler.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cyharyanto
cyharyanto merged commit e6c5c96 into master May 24, 2026
1 check passed
@cyharyanto
cyharyanto deleted the contrib/internal-research branch May 24, 2026 09:28
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