Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/design/decision-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,51 @@ Registration does not establish provenance for unrelated test-helper scaffolding
- Adopt only the command literal's `Aliases: []string{...}` field. Alias names `find` and `grep` are the product vocabulary already listed in this roadmap; upstream supplies the alias mechanism, not these names. Existing handlers, flags and query syntax remain the search command's own.
- [`command.go`, lines 66–67](https://github.com/spf13/cobra/blob/88b30ab89da2d0d0abb153818746c5a2d30eccec/command.go#L66-L67) documents the API. This adds command names, so a bare query starting with either word selects the alias; explicit `search` or `--query` preserves a literal leading word. No custom parser or new dependency is adopted.
- Entire upstream source and license bytes were fetched before the source acknowledgment and edit. Source SHA-256: `command_test.go` = `710a689a1512af3ca376a0aaaa2c0b77d10ea174f7e27db85c2f2316a087d0f3`; `command.go` = `f79613721ad04c9b438dfb30fe0ac3deca85c487658b0aa04a1ae6e4395bfd90`; `LICENSE.txt` = `5e3400b93bbb099e83e52bab885e7441750673c21f97988ca3f1240639b63283`.


## Cline legacy history source preflight (2026-11-17)

**PARTIAL; implementation HOLD.** This catalog records inspected sources and compatibility gaps. No reader is shipped, no implementation is adopted, and upstream tests were inspected but not run. The candidate scope is legacy `tasks/<id>/api_conversation_history.json`; current SDK sessions, UI-message conversion and Roo Code require separate evidence.

- Native Cline source: `cline/cline@4cdfb19a5e897b9e75827cbb4f280f322e27e44a`, [Apache-2.0 license](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/LICENSE). [`apps/vscode/src/sdk/legacy-state-reader.ts` lines 22–29](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/vscode/src/sdk/legacy-state-reader.ts#L22-L29), [53–75](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/vscode/src/sdk/legacy-state-reader.ts#L53-L75), [187–189](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/vscode/src/sdk/legacy-state-reader.ts#L187-L189) and [268–285](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/vscode/src/sdk/legacy-state-reader.ts#L268-L285) supply legacy data-root resolution, task paths, API-array reading and directory enumeration.
- Native content/role evidence: [`apps/vscode/src/sdk/legacy-task-handling.ts` lines 9–46](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/vscode/src/sdk/legacy-task-handling.ts#L9-L46) handles text, tool use, tool result, thinking and images; [123–151](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/vscode/src/sdk/legacy-task-handling.ts#L123-L151) validates user/assistant roles. These are migration routines, not an archival-reader specification: [83–120](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/vscode/src/sdk/legacy-task-handling.ts#L83-L120) distinguishes request-context truncation from the full persisted history. Do not import resume-only truncation into archival ingestion.
- Maintained connector comparison: `Dicklesworthstone/franken_agent_detection@f19e7e0018e4650842f45e85a17062e3a3705829`, [MIT license](https://github.com/Dicklesworthstone/franken_agent_detection/blob/f19e7e0018e4650842f45e85a17062e3a3705829/LICENSE). The published `franken-agent-detection=0.2.2` archive SHA-256 is `5f771fad42348fe5089f18d095157056d1e32b0fa20b40e37e2f00900523fd25`, matching its registry checksum. Fresh immutable `src/connectors/cline.rs`, `src/connectors/mod.rs`, `src/connectors/utils.rs` and `LICENSE` bytes match those four archive members. The annotated release tag resolves to this commit; absent `.cargo_vcs_info.json` and this bounded comparison do not establish whole-tree build provenance.
- Connector incompatibilities: [`src/connectors/cline.rs` lines 321–334](https://github.com/Dicklesworthstone/franken_agent_detection/blob/f19e7e0018e4650842f45e85a17062e3a3705829/src/connectors/cline.rs#L321-L334) prefers UI history, [374–379](https://github.com/Dicklesworthstone/franken_agent_detection/blob/f19e7e0018e4650842f45e85a17062e3a3705829/src/connectors/cline.rs#L374-L379) takes `role` or `type` without RawClaw role normalization, and [407–415](https://github.com/Dicklesworthstone/franken_agent_detection/blob/f19e7e0018e4650842f45e85a17062e3a3705829/src/connectors/cline.rs#L407-L415) sorts by timestamp before reindexing. [`src/connectors/utils.rs` lines 214–282](https://github.com/Dicklesworthstone/franken_agent_detection/blob/f19e7e0018e4650842f45e85a17062e3a3705829/src/connectors/utils.rs#L214-L282) flattens selected text/tool-use blocks but omits thinking/tool-result blocks. The ordering concern applies to records with sortable timestamps; legacy API arrays with all timestamps missing retain their array order through stable ties. The generic/UI behaviors and omitted content do not directly satisfy RawClaw's normalization contracts.
- Existing Go reuse requires adaptation: [`internal/parse/parse.go` lines 85–106](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/parse/parse.go#L85-L106) at `MoonCaves/rawclaw@e0420b85a30f2b4f562d72e531bcab64f23b6aa9` ([MIT license](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/LICENSE)) expects nested `message.content` for typed block arrays; a native top-level `{role, content: [...]}` record yields empty text. Top-level string content has a separate labeled fallback. Explicit wrapper wiring would be needed for native block arrays; this is not a drop-in parser.
- Open mapping decisions: legacy versus SDK/root discovery, task-history CWD lookup and refresh, canonical role/content projection, cross-root task identity and stable message references. API history may lack per-message timestamps; RawClaw already permits zero/empty timestamps. An ordinal-derived identifier can preserve an unchanged append-only prefix, but arbitrary rewrite stability is not established. Connector metadata-key guesses are not a substitute for the native producer contract. Implementation needs a separate reviewed mapping before code adoption.
## Cline SDK v1 source mechanisms (2026-11-17)

Source created here. **Source preflight only: no SDK adapter has shipped.**
This entry concerns current row-backed SDK v1 snapshots, separately from the legacy API/UI history entry above.

- Native source pin: `cline/cline@4cdfb19a5e897b9e75827cbb4f280f322e27e44a` ([Apache-2.0 license](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/LICENSE)).
The [offline reader, lines 45–76](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/core/src/runtime/host/runtime-host-support.ts#L45-L76) preserves persisted message-array order; it does not repair missing or duplicate IDs.
- [Native local backend selection, lines 64–97](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/core/src/runtime/host/host.ts#L64-L97) tries SQLite first and falls back to the file registry; no custom inactive-registry merge is implied.
The [effectively unbounded metadata caller, lines 548–563](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/core/src/session/services/persistence-service.ts#L548-L563) loads rows without root/status/parent filters before projecting metadata.
Its [SQLite full-row loader, lines 82–115](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/core/src/session/services/session-service.ts#L82-L115) and [file-index reader, lines 70–84](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/core/src/session/services/file-session-service.ts#L70-L84) provide row-backed discovery mechanisms including children, unlike capped/root-only history defaults.
- Read-only adaptation must avoid native directory creation and schema migrations; the existing [RawClaw Hermes lifecycle, lines 152–181](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/source/hermes/hermes.go#L152-L181) is a maintained local reuse lead, not Cline schema compatibility proof.
- Common blocks can use RawClaw's existing nested `message.content` extraction wrapper.
Direct file text has an exact native [formatter branch, lines 799–806](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/shared/src/llms/ai-sdk-format.ts#L799-L806) and [XML text helper, lines 1–3](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/shared/src/prompt/format.ts#L1-L3); it does not read the referenced disk path.
- Structured tool output must first follow [native typed-output/image normalization, lines 544–637](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/shared/src/llms/ai-sdk-format.ts#L544-L637).
Cline's [lock entry, line 874](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/bun.lock#L874) resolves `@ai-sdk/anthropic@4.0.78`.
That published package's converter matches [vercel/ai@50203a81019c2117c413b959398443ec7f84f325, lines 648–679](https://github.com/vercel/ai/blob/50203a81019c2117c413b959398443ec7f84f325/packages/anthropic/src/convert-to-anthropic-prompt.ts#L648-L679): typed `json`/`error-json` output values become JSON text ([Apache-2.0 notice](https://github.com/vercel/ai/blob/50203a81019c2117c413b959398443ec7f84f325/LICENSE)).
This is not authority to stringify raw stored arrays before normalization, index recognized image bytes, or claim Go/JavaScript byte-identical JSON rendering.
- Nonhex native **message IDs** need deterministic reference-compatible mapping: [RawClaw ref parsing, lines 209–221](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/agentproto/types.go#L209-L221) hex-validates only the message component, not the session component.
Existing `google/uuid v1.6.0` provides [NewSHA1, lines 53–59](https://github.com/google/uuid/blob/0f11ee6918f41a04c201eceeadf612a377bc7fbc/hash.go#L53-L59) ([BSD-3-Clause license](https://github.com/google/uuid/blob/0f11ee6918f41a04c201eceeadf612a377bc7fbc/LICENSE)); [Pomerium's maintained nested-namespace caller, lines 509–517](https://github.com/pomerium/pomerium/blob/281830c45247c964507a705edf532067c8e31151/config/session.go#L509-L517) supplies the pair-mapping mechanism ([Apache-2.0 license](https://github.com/pomerium/pomerium/blob/281830c45247c964507a705edf532067c8e31151/LICENSE)).
A future RawClaw product/source identity binding must be explicit and frozen; Pomerium's private namespace constant is not RawClaw's domain. No ordinal/random reader IDs or arbitrary upstream rewrite-invariance claim follows.
- Native **session IDs** are a separate contract. The [default producer, lines 1–6](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/shared/src/session/index.ts#L1-L6) emits decimal milliseconds, `_`, and five lowercase alphanumeric characters; the [runtime caller, lines 502–504](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/core/src/runtime/host/local-runtime-host.ts#L502-L504) retains a supplied trimmed ID or calls that producer.
The [child producer, lines 5–25](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/core/src/session/models/session-graph.ts#L5-L25) sanitizes tokens and forms root/agent or team-task identities; [child row construction, lines 89–111](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/core/src/session/team/team-child-session-manager.ts#L89-L111) records the root parent and subagent flag. Message-reference mapping alone supplies no reason to hash session IDs or discard that lineage.
- The native CLI exposes [executable `cline`, package lines 38–40](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/cli/package.json#L38-L40) and [`--id <session-id>`, program line 48](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/cli/src/commands/program.ts#L48).
[main.ts lines 727–737](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/cli/src/main.ts#L727-L737) trims/rejects empty input; [the actual resumed-start caller, lines 272–286](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/apps/cli/src/runtime/interactive/session-runtime.ts#L272-L286) passes that ID into `config.sessionId`. This establishes the native command/identity correspondence, not live execution, legacy-task compatibility, or access to every custom config/backend.
- Preserving native session IDs is not drop-in RawClaw resume support: [runResume, lines 533–562](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/cli/cli.go#L533-L562) gates registered exact lookup on the [UUID-shaped check, lines 614–630](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/cli/cli.go#L614-L630), while its non-UUID fallback omits Cline.
Ref lookup also needs bounded compatibility review: [session display uses first eight runes](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/text/helpers.go#L28-L31), so timestamp/root-child prefixes can collide; [prefix SQL uses unescaped `LIKE`, lines 104–113](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/store/sessions.go#L104-L113), giving `_` wildcard semantics. Colon remains the ref delimiter; unrestricted caller-supplied IDs are not thereby proven compatible.
- Implementation remains on hold pending a selected metadata-refresh scope and source-aware resume integration.
Registry metadata and message artifacts are separate files, while [the existing watermark skip, lines 346–374](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/index/containers.go#L346-L374) follows one backing path.
Discovery snapshots/full reindex can take current registry metadata; automatic registry-only refresh is a separate, unresolved scope choice, not an assumed arbitrary-mutation guarantee.
A DB-only backing path is insufficient too: [persistSessionMessages, lines 204–240](https://github.com/cline/cline/blob/4cdfb19a5e897b9e75827cbb4f280f322e27e44a/sdk/packages/core/src/session/stores/session-manifest-store.ts#L204-L240) can resolve an existing row and write only the JSON message artifact.
Required/unique IDs need explicit malformed-record errors; native offline reading supplies no repair.
- Local normalized retention uses the existing [durable-vault path, lines 606–633](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/index/containers.go#L606-L633).
Remote archive transport is separately [hardcoded to three source trees, lines 21–31](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/archive/layout.go#L21-L31); SDK archive transport is not established here.
- Registration currently marks every source [resume-supported, cli.go lines 634–638](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/cli/cli.go#L634-L638).
The [central unknown-source branch, source.go lines 149–150](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/source/source.go#L149-L150) defaults to Claude; [command construction, cli.go lines 766–769](https://github.com/MoonCaves/rawclaw/blob/e0420b85a30f2b4f562d72e531bcab64f23b6aa9/internal/cli/cli.go#L766-L769) ignores `Container.ResumeArgv`.
Native argv/ID binding and caller integration remain required before SDK registration; this source-only catalog does not clear a capability guard or promise actual Cline resume support.
Loading