Skip to content

ADR-0001: the kernel / source-adapter / codegen boundary, rewritten from the code (R5 L0) - #255

Merged
luisleo526 merged 2 commits into
mainfrom
docs/adr-kernel-adapter-boundary
Sep 20, 2026
Merged

luisleo526 merged 2 commits into
mainfrom
docs/adr-kernel-adapter-boundary

Conversation

@luisleo526

@luisleo526 luisleo526 commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

What

R5 lane L0 (design #256 §2.vi): docs/adr/0001-kernel-adapter-boundary.md is rewritten from the code, replacing the two earlier drafts that were written from memory and reviewed as inaccurate.

  • The three-layer boundary (kernel / source-adapter / codegen) and why the adapter stays in the engine.
  • How the kernel works standalone: lifecycle, the five host callbacks (not close-only), NativeRunSpec scope and its five explicit non-owns, the five trigger kinds and five intents, owners/groups/PointBudget, fills via on_native_applied + native_events, the reporting caveat for bare hosts.
  • How the adapter reflects TradingView for parity — each TV rule pointed at its real code site (the invented "KI-62 priority" line is replaced by what compat/pine/order_priority.cpp does).
  • Current state vs target, honestly: the 57 runtime PF_API symbols and the real C-ABI gap, HTF not reachable from a bare host, what TradingView residue actually survives in the kernel, the build layout (one library, the market_admission.cpp boundary bug fixed by Kernel-only build target: pineforge_kernel + PINEFORGE_BUILD_SOURCE_LAYER (R5 L1) #257), the two Pine-free examples; follow-ups point at the roadmap (Native feature-parity design: gaps, kernel-vs-adapter rulings, lane roadmap #256 §3.2) instead of restating it.

Also: docs/pages/native-engine.md corrections (callbacks, epochs v5/v17, removed stale CapAttachment/OrderPriority/IntradayCap and rich-run claims; added the calculate-on-fill hook, the interim HTF recipe, the open-bar lookahead warning) and a README architecture line.

Evidence

  • ADR: 105 citations, 105 resolve in this tree (script-checked); native-engine.md: 24/24.
  • Every §2.vi row 1–12 addressed (listed in the executor report); supervisor spot-checked the string-sentinel decoding (engine_trade_accessors.cpp:155-167), order_priority.cpp:13-59, and native_run_spec.hpp:173-174.
  • ci_preflight.py PASS. Docs only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CSmYixVAp4NqWpBZxkrLPT

@luisleo526
luisleo526 force-pushed the docs/adr-kernel-adapter-boundary branch from ec77693 to 72c4c4b Compare September 19, 2026 23:46
@luisleo526 luisleo526 changed the title docs(adr): kernel / source-adapter / codegen boundary — PineScript is optional ADR-0001: the kernel / source-adapter / codegen boundary, rewritten from the code (R5 L0) Sep 19, 2026
@luisleo526
luisleo526 force-pushed the docs/adr-kernel-adapter-boundary branch from 72c4c4b to 08f075d Compare September 20, 2026 00:20
luisleo526 and others added 2 commits September 20, 2026 11:05
The kernel / source-adapter / codegen boundary ADR is rewritten from the
code-grounded correction list in docs/design/native-feature-parity.md §2.vi:
five trigger kinds and five intents, sizing resolved by the host, the
reporting caveat for bare hosts, HTF not reachable from a bare host, no
kernel TU reaching a source header, the opaque StrategyOverrides pointer,
which TradingView residue actually survives in the kernel, the 57 runtime
PF_API symbols and the real C-ABI gap, the two Pine-free examples, the
build layout, and the host constructors. The earlier invented adapter
priority line is replaced by what order_priority.cpp does. 105 citations,
all resolving in this tree.

docs/pages/native-engine.md: the host callbacks are not close-only; epochs
native_order_v5 / engine_script_run_v17; the CapAttachment / OrderPriority /
IntradayCap claim and the rich-run refusal claim are removed; the
calculate-on-fill hook, the interim HTF recipe and the open-bar lookahead
warning are added. README's architecture section no longer repeats a
corrected claim.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSmYixVAp4NqWpBZxkrLPT
…, kernel twins, bare-host surface, ab9714b defined)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CSmYixVAp4NqWpBZxkrLPT
@luisleo526
luisleo526 force-pushed the docs/adr-kernel-adapter-boundary branch from 08f075d to 39b05f6 Compare September 20, 2026 03:06
@luisleo526
luisleo526 merged commit e7350f7 into main Sep 20, 2026
11 checks passed
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