stable-harness 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +10 -0
  2. package/docs/0.1.0-p0-runtime-control-plane-plan.zh.md +171 -0
  3. package/docs/0.1.0-retry-policy.zh.md +87 -0
  4. package/docs/0.1.0-stable-runtime-development-roadmap.zh.md +393 -0
  5. package/docs/0.1.0-tool-guard-benchmark.zh.md +42 -0
  6. package/docs/adapter-contract.md +199 -0
  7. package/docs/architecture/backend-comparison.md +41 -0
  8. package/docs/architecture/runtime-events.md +263 -0
  9. package/docs/architecture/runtime-events.zh.md +248 -0
  10. package/docs/architecture/system-architecture.zh.md +435 -0
  11. package/docs/compatibility-matrix.md +139 -0
  12. package/docs/engineering-rules.md +111 -0
  13. package/docs/evaluation/0.1.0-bfcl-targeted-model-matrix.zh.md +1632 -0
  14. package/docs/evaluation/0.1.0-bfcl-targeted-review-matrix.zh.md +1952 -0
  15. package/docs/evaluation/0.1.0-bfcl-tool-guard.zh.md +1427 -0
  16. package/docs/granite-tool-calling-comparison.zh.md +206 -0
  17. package/docs/guides/getting-started.md +126 -0
  18. package/docs/guides/index.md +40 -0
  19. package/docs/guides/integration-guide.md +126 -0
  20. package/docs/guides/operator-runbook.md +153 -0
  21. package/docs/guides/workspace-authoring.md +212 -0
  22. package/docs/implementation-blueprint.md +233 -0
  23. package/docs/memory/0.1.0-memory-design.zh.md +719 -0
  24. package/docs/memory/0.1.0-step-09-deepagents-native-memory.zh.md +146 -0
  25. package/docs/memory/0.1.0-step-09-langmem-shaped-provider.zh.md +169 -0
  26. package/docs/memory/0.1.0-step-09-memory-adapter-projection.zh.md +123 -0
  27. package/docs/memory/0.1.0-step-09-memory-contract.zh.md +169 -0
  28. package/docs/memory/0.1.0-step-09-memory-governance-approval.zh.md +143 -0
  29. package/docs/memory/0.1.0-step-09-memory-lifecycle-hooks.zh.md +150 -0
  30. package/docs/memory/0.1.0-step-09-memory-maintenance-boundary.zh.md +118 -0
  31. package/docs/memory/0.1.0-step-09-memory-persistence-boundary.zh.md +118 -0
  32. package/docs/product/adoption-playbook.md +145 -0
  33. package/docs/product/market-positioning.md +137 -0
  34. package/docs/product-boundary.md +258 -0
  35. package/docs/protocols/http-runtime.md +37 -0
  36. package/docs/protocols/langgraph-compatible.md +107 -0
  37. package/docs/protocols/openai-compatible.md +121 -0
  38. package/docs/tooling/0.1.0-bettercall-tool-quality.zh.md +231 -0
  39. package/package.json +3 -1
@@ -0,0 +1,139 @@
1
+ # Stable Harness Compatibility Matrix
2
+
3
+ This document tracks compatibility work against `agent-harness` while preserving the clean runtime boundary.
4
+
5
+ `stable-harness` should not replicate `agent-harness` as a project. It should only keep the compatibility surface needed for downstream workspaces while rebuilding runtime-owned capabilities as small, typed, pluggable modules.
6
+
7
+ ## Classification
8
+
9
+ Every compatibility item must use one of these decisions:
10
+
11
+ - `passthrough`: the upstream backend already owns the capability
12
+ - `runtime wrapper`: `stable-harness` adds lifecycle, events, governance, persistence, or protocol access around upstream execution
13
+ - `plugin capability`: runtime-owned but optional and replaceable
14
+ - `downstream workspace`: application-specific behavior owned by EasyNet, Flev, or another workspace
15
+ - `do not build`: duplicates upstream execution semantics or hardcodes downstream behavior
16
+
17
+ ## Current EasyNet Gate
18
+
19
+ EasyNet currently uses this local compatibility path:
20
+
21
+ ```text
22
+ stable-harness -> file:../stable-harness
23
+ ```
24
+
25
+ The passing gate proves that `stable-harness` can run the current EasyNet E2E suite. It does not prove full `agent-harness` parity.
26
+
27
+ The current migration implementation lives under `runtime/compat`. New runtime capabilities should not extend that folder by default; they should move into typed packages or pluggable runtime modules.
28
+
29
+ The root package now exposes only native stable runtime entrypoints. The `agent-harness` API remains available only from `./compat/agent-harness.js` for explicit compatibility imports.
30
+
31
+ Verified gates:
32
+
33
+ - `npm test` in EasyNet
34
+ - `npm run test:botbotgo:full` in EasyNet
35
+ - `npm run test:stable-native-cli` in EasyNet
36
+ - stable-harness package tests for explicit compat import support through `./compat/agent-harness.js`
37
+ - CLI compatibility through EasyNet's package-local `node_modules/.bin/botbotgo`
38
+ - native typed tool execution through EasyNet's package-local `node_modules/.bin/botbotgo --tool`
39
+ - native CLI coverage through EasyNet's package-local `node_modules/.bin/stable-harness`
40
+
41
+ ## Compatibility Rows
42
+
43
+ | Capability | Current owner | Decision | Current status | Next action |
44
+ | --- | --- | --- | --- | --- |
45
+ | Public compat API: `createAgentHarness`, `request`, `stop` | `compat/agent-harness` | runtime wrapper | Minimal EasyNet-compatible facade exists only on the explicit compat subpath | Keep as a thin migration facade; move implementation behind core runtime contracts |
46
+ | `botbotgo` CLI entrypoint | stable CLI facade | runtime wrapper | Natural-language requests stay on the compatibility runner; typed `--tool` requests now use native stable runtime/tool gateway | Continue moving typed surfaces first; switch natural-language requests only after upstream DeepAgents delegation/tool-calling satisfies the real matrix |
47
+ | Workspace YAML loading | stable runtime | plugin capability | Loads EasyNet agent/model/tool/skill/memory config; EasyNet config now uses `apiVersion: stable-harness.dev/v1` | Move package-local loader into `@stable-harness/workspace-yaml` as the single implementation |
48
+ | DeepAgents execution semantics | DeepAgents | passthrough | Native adapter can call upstream `createDeepAgent`; EasyNet direct tests use native runtime/tool calls, while natural-language `botbotgo` compatibility still uses the compatibility runner | Move downstream natural-language CLI flows from compat runner to native adapter when upstream tool calling is stable |
49
+ | Subagent delegation semantics | DeepAgents | passthrough | Current runner asks model for a routed agent list and emits stable events; direct user-text route shortcuts were removed from compat | Keep event projection; move actual delegation to upstream DeepAgents task/subagent primitives |
50
+ | Delegation plan events | stable runtime | runtime wrapper | Compat emits `delegation.plan` and `delegation.start`; native trace now projects observed upstream DeepAgents `task` tool calls as `delegation.start` and `delegation.completed` entries without selecting agents locally | Keep as normalized observability only; do not synthesize task calls or route from text |
51
+ | Explicit tool execution | stable runtime tool gateway | runtime wrapper | Native `RuntimeRequest.toolCall` invokes only the selected agent's declared tools through `toolGateway`; EasyNet tool matrix, contract tests, and native CLI E2E no longer use compat `toolName`/`args`; the compat direct-invoke request fields were removed | Keep direct tool execution native-only and continue migrating remaining natural-language compat paths separately |
52
+ | Upstream tool calling | upstream backend | passthrough | DeepAgents receives tool gateway tools, but the current remote Ollama path is not yet stable enough to replace compat tool selection | Keep as upstream passthrough; do not add prompt or keyword repair in the adapter |
53
+ | Tool start/result events | stable runtime | runtime wrapper | Native runtime emits `runtime.tool.direct.started` and `runtime.tool.direct.completed`; DeepAgents adapter emits upstream tool events under `runtime.adapter.event`; `projectRuntimeTrace` exposes a normalized trace view consumed by native CLI `--trace` and `--trace-json`; native CLI now streams `--trace` rows as events happen, so long/timeout runs expose progress before finalization; EasyNet asserts native `subscribe` tool events without compat `dataListener` | Continue moving downstream CLI trace checks from compat dataListener to native trace output |
54
+ | Tool argument generation | upstream backend | passthrough | Compatibility runner uses constrained model prompts; user-input JSON tool-call pre-execution was removed from compat | Remove from default DeepAgents adapter; keep only optional tool gateway repair/validation if configured |
55
+ | Required evidence tools | stable runtime policy | plugin capability | Native runtime validates `executionContract.requiredEvidenceTools` from emitted tool events and fails incomplete runs; compat repair for missing required evidence was removed | Keep as validation policy only; do not synthesize or repair tool calls from this contract |
56
+ | Required planning checkpoint | stable runtime policy | plugin capability | Native runtime validates `executionContract.requiresPlan` by observing `write_todos` tool events and fails incomplete runs | Keep as validation policy only; TODO execution remains upstream/back-end owned |
57
+ | TODO trace projection | stable runtime event/view | runtime wrapper | Native `projectRuntimeTrace` projects observed upstream `write_todos` tool completions as `plan.updated`; `readPlanTodos` normalizes structured TODO payloads for presentation; stable no longer provides local `write_todos` or `read_todos` tools | Keep as presentation/event projection only; do not parse TODO text to create tool calls |
58
+ | Built-in `write_todos` and `read_todos` | DeepAgents | passthrough/runtime wrapper | DeepAgents owns its built-in `write_todos`; stable observes upstream `write_todos`/`task` tool calls through middleware without injecting same-name tools; the stable tool gateway planning-tool implementation was removed | Keep observing upstream built-ins; do not synthesize planning or delegation calls |
59
+ | Model provider path | upstream backend adapter | passthrough | Minimal Ollama prompted JSON path supports EasyNet | Move provider handling into backend adapter config; avoid stable-owned model execution semantics |
60
+ | Result compression/final response | runtime optional layer | plugin capability | Not formalized; current runner returns model/fallback text | Design as optional output policy with typed config |
61
+ | Approvals/HITL | stable governance | plugin capability | Not implemented in compatibility runner | Build as independent governance capability |
62
+ | Sandbox policy | stable governance | plugin capability | Not implemented in compatibility runner | Build as independent sandbox policy capability |
63
+ | Run persistence/recovery | stable runtime | plugin capability | Not implemented in compatibility runner | Build as independent run store and recovery capability |
64
+ | Memory lifecycle | stable runtime | plugin capability | Not implemented beyond config load | Build memory lifecycle outside backend execution semantics |
65
+ | Replay/artifacts/traces | stable runtime | plugin capability | Runtime records events per run and exposes `projectRuntimeTrace`; native CLI can print stable trace rows or JSON trace; HTTP exposes `/runs/{requestId}/trace` | Add protocol streaming/export over the same event model |
66
+ | EasyNet specialist prompts and tool ownership | EasyNet workspace | downstream workspace | Owned by EasyNet YAML and resources | Keep out of generic runtime |
67
+ | Finance, Kubernetes, QA, release, secretary rules | EasyNet workspace | downstream workspace | Encoded in EasyNet agents, tools, and skills | Do not move into `stable-harness` runtime |
68
+ | Natural-language keyword routing | none | do not build | Forbidden | Use typed config, metadata, runtime state, or upstream primitives only |
69
+ | TODO text to tool-call inference | none | do not build | Forbidden | Use upstream tool calls or typed runtime policy only |
70
+
71
+ ## Current Technical Debt
72
+
73
+ The EasyNet compatibility runner is intentionally temporary. It contains behavior that must be split before `stable-harness` becomes a clean production runtime:
74
+
75
+ - `runtime/compat` should remain a migration-only layer and must not become the default stable runtime core
76
+ - routing prompt and parser should become either upstream DeepAgents delegation passthrough or an optional typed router capability
77
+ - natural-language compat tool selection should be replaced by upstream DeepAgents tool calling; direct `toolName`/`args` invocation moved to native `RuntimeRequest.toolCall`, and execution contracts moved to native validation
78
+ - local TODO built-ins were removed; native planning evidence must come from observed upstream DeepAgents `write_todos`
79
+ - prompted JSON tool choice should not be the stable default when upstream tool calling exists
80
+ - compatibility CLI output should be replaced by native trace projection where the behavior is present in runtime events
81
+
82
+ Current migration evidence:
83
+
84
+ - `stable-harness` native CLI can run an EasyNet specialist through the real remote Ollama model for non-tool synthesis.
85
+ - `stable-harness` native runtime can load EasyNet workspace tools through `createModuleToolGateway`.
86
+ - `stable-harness` native runtime and native CLI can execute an explicit EasyNet `git_command` request through `RuntimeRequest.toolCall` and `createModuleToolGateway`, without using `runtime/compat`.
87
+ - EasyNet's package-local `botbotgo --tool` now executes typed tool calls through native stable runtime/tool gateway and emits native trace rows; natural-language `botbotgo` requests remain on compat.
88
+ - EasyNet's model/context matrix can run in native diagnostic mode with `EASYNET_E2E_NATIVE=1`; this drives `botbotgo --native --trace` while preserving the default compat matrix.
89
+ - EasyNet now has `npm run test:stable-native-diagnostics`, a non-compat-readiness gate that requires native natural-language runs to emit stable trace before they are allowed to fail on known upstream orchestration gaps.
90
+ - `stable-harness` native CLI `--trace` and `--trace-json` project `runtime.tool.direct.started` and `runtime.tool.direct.completed` from runtime events; EasyNet native CLI E2E asserts this trace without compat.
91
+ - `stable-harness` native trace projects observed `write_todos` completions as `plan.updated`; `readPlanTodos` reads structured TODO payloads for presentation, and does not synthesize TODO calls or parse TODO text.
92
+ - DeepAgents adapter now installs a `StableHarnessObserver` middleware that observes upstream built-in `write_todos` and `task` tool calls and emits stable `runtime.adapter.event` records without registering or replacing those tools.
93
+ - The same observer now records upstream DeepAgents filesystem built-ins (`ls`, `read_file`, `write_file`, `edit_file`, `glob`, `grep`) so native traces expose policy-denied filesystem attempts without replaying or replacing upstream tools.
94
+ - Native `projectRuntimeTrace` now projects observed upstream DeepAgents `task` calls as stable delegation trace entries, preserving the upstream `subagent_type` as detail when present.
95
+ - Native DeepAgents adapter treats `config.builtinTools.modelExposed` as an explicit governance switch: `false` hides upstream `task`, `["task"]` restricts task targets to workspace-declared subagents, and omitted config preserves upstream DeepAgents task behavior including `general-purpose`.
96
+ - EasyNet native contract tests now assert that invalid upstream task targets such as `research-analyst` are blocked by the stable adapter policy and are not locally remapped to an EasyNet specialist.
97
+ - EasyNet native contract tests also assert that specialists with `modelExposed: false` block upstream `task` completely.
98
+ - Native DeepAgents adapter maps stable `config.builtinTools.filesystem: false` to upstream DeepAgents filesystem permissions that deny `read` and `write` on `/**`, unless the workspace explicitly provides `config.deepagents.permissions`.
99
+ - Native CLI `--trace` streams runtime trace rows before completion, making native adapter hangs/timeouts observable.
100
+ - Compatibility CLI output formatting is centralized in `formatCompatDelta`, which consumes the shared structured TODO reader instead of parsing TODO payloads in the CLI entrypoint.
101
+ - EasyNet native contract tests assert `runtime.tool.direct.started` and `runtime.tool.direct.completed` through stable runtime `subscribe`, without compat `dataListener`.
102
+ - Native workspace loader now discovers `resources/skills/*/SKILL.md` as stable skill inventory and reads each agent's `skills` and `memory` refs without executing them.
103
+ - Native workspace loader reads agent metadata descriptions, and the DeepAgents adapter passes those descriptions through for upstream subagent definitions.
104
+ - EasyNet skill metadata contract now consumes native `workspace.skills` inventory instead of the legacy `runtime/skills/skill-metadata.js` helper.
105
+ - Native workspace loader records agent source paths and discovers module tool ids from `export const <toolId> = tool(...)`, so tool inventory no longer depends on filename-only compatibility behavior.
106
+ - EasyNet contract and real integration tests no longer import the legacy `workspace/compile.js`; they use native `loadWorkspaceFromYaml` for model, agent, tool, skill, memory, source, and response-format inventory.
107
+ - EasyNet specialist response formats are explicit in workspace YAML instead of relying on the legacy compiler's default response-format completion.
108
+ - EasyNet tests and scripts no longer import `compat/agent-harness.js`; remaining EasyNet compatibility coverage goes through the package-local `botbotgo` CLI while native coverage uses `stable-harness` runtime/CLI entrypoints.
109
+ - `stable-harness` native runtime validates EasyNet release `requiredEvidenceTools` and reports missing evidence without compat repair prompts.
110
+ - `stable-harness` native runtime validates EasyNet specialist `requiresPlan` and reports missing `write_todos` checkpoints without synthesizing TODO calls.
111
+ - EasyNet's real specialist tool matrix now executes through native stable `toolCall`; compat request `toolName`/`args` no longer exists as a migration path.
112
+ - EasyNet real and full matrix scripts now resolve `botbotgo` from the workspace package bin instead of a checkout-internal `stable-harness/dist/cli.js` path.
113
+ - EasyNet workspace YAML now declares `apiVersion: stable-harness.dev/v1`; the old `agent-harness/v1alpha1` name is no longer the application config identity.
114
+ - Compatibility runner no longer exposes local `write_todos` or `read_todos`; visible planning evidence in native paths must come from observed upstream DeepAgents built-ins, not stable-owned duplicate tools.
115
+ - DeepAgents 1.9.1 rejects custom tools named `write_todos` because planning is a built-in upstream tool; the native adapter intentionally does not inject stable planning tools over upstream built-ins.
116
+ - Native EasyNet research still is not a full replacement for compat: real runs can fail before synthesis when the upstream model selects the built-in `task` tool with an invalid agent type such as `research-analyst`, and repeated checks also hit remote model `502 Bad Gateway` or 120s timeouts; this must be solved by upstream delegation/tool behavior, endpoint stability, or typed workspace configuration, not by runtime keyword routing.
117
+ - A native diagnostic matrix sample against EasyNet `research-stock` now observes stable trace rows and classifies upstream filesystem access as `native_filesystem_denied` when EasyNet disables filesystem built-ins; the current DeepAgents API still exposes filesystem middleware by default, so this remains an upstream/workspace configuration blocker rather than a stable runtime routing feature.
118
+ - The native diagnostic gate now separates stable readiness from compat-style business assertions: `passed` means native trace/readiness when `EASYNET_E2E_REQUIRE_NATIVE_TRACE=1`, while `businessPassed` keeps the old full-matrix success signal for natural-language migration work. Filesystem-denied native blockers must include a concrete upstream builtin trace such as `agent.tool.start:grep`.
119
+ - Compatibility runner no longer pre-executes JSON tool calls parsed directly from user input; explicit execution belongs to native typed `RuntimeRequest.toolCall`.
120
+ - Compatibility runner no longer routes directly from user text patterns such as explicit `delegate/route/委托 <agentId>`; routing now goes through the compat model-routing prompt until upstream DeepAgents delegation replaces it.
121
+ - Native upstream DeepAgents tool-calling with the current remote Ollama path is not yet a replacement for the compatibility runner; a direct `git_command` request hung until terminated. Keep compat tool-selection behavior until upstream tool-calling is stable or an explicit typed tool-execution policy replaces it.
122
+
123
+ ## Acceptance Rule
124
+
125
+ A compatibility feature is acceptable only when all of these are true:
126
+
127
+ - it does not duplicate a current DeepAgents execution primitive in the default path
128
+ - it can be disabled, replaced, or moved behind typed config
129
+ - it has focused tests that assert runtime contracts rather than downstream business cases
130
+ - it keeps downstream product logic in the workspace
131
+ - it improves migration without expanding the public runtime API unnecessarily
132
+
133
+ ## Next Cleanup Sequence
134
+
135
+ 1. Replace the compatibility runner's default DeepAgents path with upstream `createDeepAgent`.
136
+ 2. Replace natural-language compat tool selection with upstream DeepAgents tool calling once the remote Ollama tool-call path is stable.
137
+ 3. Move remaining CLI trace checks from compat `dataListener` to native `projectRuntimeTrace` where native runtime events exist.
138
+ 4. Keep only the explicit `./compat/agent-harness.js` facade until downstream workspaces can use the native stable runtime API directly.
139
+ 5. Add tests for each runtime capability boundary before broadening beyond EasyNet.
@@ -0,0 +1,111 @@
1
+ # Stable Harness Engineering Rules
2
+
3
+ These rules are mandatory for all implementation work in this repository.
4
+
5
+ ## Size Limits
6
+
7
+ Hard limits:
8
+
9
+ - Source code file: 500 lines maximum.
10
+ - Function: 100 lines maximum.
11
+ - Direct files per folder: 10 files maximum.
12
+
13
+ The limits apply to source code and project-authored configuration. Generated output under `dist`, `coverage`, or package manager folders is ignored.
14
+
15
+ ## How to Stay Under the Limits
16
+
17
+ Split by product boundary:
18
+
19
+ - runtime contract
20
+ - workspace parsing
21
+ - adapter integration
22
+ - protocol adapter
23
+ - policy evaluation
24
+ - memory store
25
+ - CLI command
26
+ - test fixture
27
+
28
+ Do not split by vague utility names when a product boundary is available.
29
+
30
+ ## Layering Rules
31
+
32
+ `core` must stay backend-neutral.
33
+
34
+ `workspace-yaml` may compile backend-specific config, but it must not execute backend behavior.
35
+
36
+ Adapters may import upstream frameworks. Core packages must not import adapters.
37
+
38
+ Protocol packages may import core runtime contracts. They must not import backend SDKs directly.
39
+
40
+ Governance packages may inspect structured policy, metadata, tool IDs, approval state, and runtime records. They must not inspect user prose to infer intent.
41
+
42
+ ## Generic Runtime Rules
43
+
44
+ Native runtime code must stay generic. Do not add behavior that only makes sense for one downstream workspace, business domain, benchmark case, prompt wording, model family, or backend quirk.
45
+
46
+ New concepts are allowed only when `stable-harness` clearly owns the runtime/control-plane capability. If an upstream backend already has a concept for the behavior, expose or configure that concept through adapter passthrough instead of inventing a stable-owned replacement.
47
+
48
+ Every runtime capability must be modular: it needs a narrow interface, explicit config, focused tests, and a replacement point. Capabilities such as approvals, events, memory, tool gateway, replay, artifacts, sandbox policy, protocol serving, and adapter execution must not be bundled into one non-replaceable subsystem.
49
+
50
+ Workflow graphs and workflow routing are runtime inventory, not generic intent inference. Route selection must come from typed config, explicit request metadata, operator selection, or a future pluggable router capability; it must not be hardcoded from natural-language prompts.
51
+
52
+ Recovery logic may react to structured adapter events only through typed
53
+ runtime config. Core recovery code must not know backend tool names, downstream
54
+ error strings, or application-specific retry instructions.
55
+
56
+ Workspace YAML must not default an agent to a specific backend. `Agent.spec.backend`
57
+ is required so scaffolded examples can choose DeepAgents first without making
58
+ the generic schema DeepAgents-shaped.
59
+
60
+ Native workspace loading must preserve adapter and backend names as configured.
61
+ Compatibility aliases belong in explicit compat modules or adapter-owned config,
62
+ not in the generic YAML schema.
63
+
64
+ ## Feature Preflight Rules
65
+
66
+ Before adding any runtime, adapter, tool, or compatibility feature:
67
+
68
+ - Inspect the current upstream framework behavior first.
69
+ - Prove that `stable-harness` actually owns the product capability.
70
+ - Prefer upstream passthrough when DeepAgents, LangChain, or another backend already provides the primitive.
71
+ - Avoid adding a stable-owned product concept when typed upstream config or adapter passthrough is enough.
72
+ - Do not add local versions of upstream built-in tools such as DeepAgents planning, delegation, filesystem, or memory primitives.
73
+ - If the capability is only needed to reproduce old `agent-harness` output, keep it out of native runtime and require a documented migration reason.
74
+ - If there is no current product need, do not implement the feature.
75
+
76
+ ## Testing Rules
77
+
78
+ Every new runtime behavior needs at least one focused test.
79
+
80
+ Tests should verify boundaries:
81
+
82
+ - YAML compiles into typed runtime state
83
+ - adapters receive explicit config
84
+ - runtime emits stable events
85
+ - governance decisions use structured policy
86
+ - forbidden keyword heuristics are absent from generic runtime packages
87
+
88
+ ## Documentation Rules
89
+
90
+ Every product-visible behavior should be documented before or with implementation.
91
+
92
+ Documentation should explain:
93
+
94
+ - which layer owns the behavior
95
+ - what is public product surface
96
+ - what remains backend-specific
97
+ - what is intentionally not supported
98
+
99
+ ## Review Checklist
100
+
101
+ Before merging a change, verify:
102
+
103
+ - no source file exceeds 500 lines
104
+ - no function exceeds 100 lines
105
+ - no folder has more than 10 direct files
106
+ - no generic runtime code contains downstream domain heuristics
107
+ - no adapter reimplements upstream semantics unnecessarily
108
+ - every new feature has an upstream capability check and product need
109
+ - every new native concept has a generic runtime owner and is not an upstream duplicate
110
+ - every new capability can be enabled, disabled, replaced, and tested independently
111
+ - no public API grows without a product-boundary reason