feat(kernel): define stable Neural surface (NRCL-66) - #25
Conversation
|
Linked to Plane Work Item(s) References
This comment was auto-generated by Plane |
📚 Documentation Status✅ Code changes detected
This comment is automatically generated by the documentation workflow. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11b8b9a91f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| def _event_sort_key(event: ReplayEvent) -> tuple[str, str, str, str, str, str]: | ||
| payload = event.as_dict() | ||
| return ( | ||
| payload["observed_at"], |
There was a problem hiding this comment.
Sort replay events by actual timestamp
When observations include fractional seconds, ordering by the formatted timestamp string can put a later event before an earlier whole-second event (for example, 2026-07-29T12:00:00.100000Z sorts before 2026-07-29T12:00:00Z). Since replay() then overwrites latest in that sorted order, the final snapshot can keep the older market price instead of the latest observation; use a chronological timestamp key rather than the display string for replay ordering.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 200828bb0af75e219dc43f5b41da7f28a82ae55b: replay ordering now uses parsed UTC datetimes. Added a fractional-second regression proving the latest observation wins.
| if result.get("market_count") != 2: | ||
| raise ReleaseSmokeError("kernel replay market count changed") |
There was a problem hiding this comment.
Validate the replay snapshot in smoke
In the wheel/sdist smoke jobs, this helper is the release gate for the installed replay contract, but it accepts a result with market_count == 2 and an empty or malformed snapshot (the new unit test even uses snapshot: [] as the passing case). If ReplayResult.as_dict() or the CLI output drops the final snapshot while preserving the digest and counts, the release candidate still passes even though the documented replay output is broken; assert the snapshot has the expected two market entries and latest prices.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 200828bb0af75e219dc43f5b41da7f28a82ae55b: installed-artifact smoke now requires the exact two-market snapshot and latest prices. Added a rejection test for an empty snapshot.
|
|
||
|
|
||
| def _decimal_text(value: Decimal) -> str: | ||
| normalized = value.normalize() |
There was a problem hiding this comment.
Make replay digests independent of Decimal context
When host code has changed the process-wide decimal precision, Decimal.normalize() rounds through that ambient context, so the same replay inputs can serialize differently and produce a different digest (with precision 1, even run_demo_replay() raises because the built-in digest changes). A stable canonical replay should not depend on whatever decimal.getcontext().prec the embedding app configured; format under a fixed/local context or avoid context-sensitive normalization.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 200828bb0af75e219dc43f5b41da7f28a82ae55b: decimal serialization no longer calls context-sensitive normalize(). Added a precision-1 regression proving digest and payload stability.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Outcome
Defines the narrow, dependency-free Neural kernel surface required by Plane story NRCL-66 and the accepted Neural + Vaticor Launch Blueprint v3.
Changes
neural.kernelas the stable import boundaryneural --json replay demoand kernel capability output--no-depsAcceptance
Exact candidate
11b8b9a91f0e4038ea726e9097fbb2b65914bfe1bebd35375e382c8e82e268e3225e63989a44e138codex/nv-010-stable-kernelValidation
uv run --extra dev ruff check .— passeduv run --extra dev mypy neural— passed, 70 source filesuv run --extra dev pytest -q— 124 passed, 6 skippeduv lock --check— passed--no-deps— passed on Python 3.10, 3.11, and 3.12569f87947428d4d093425134181b754ca974675aa7c74fc2cb73a8e193f5b4e64a99ded9e1ce6382abb1923272fb229b08094eef92f72930b7338446f59ed54cRisk and boundaries
Risk: medium. Public Python and CLI compatibility surface changes.
No provider calls, credentials, package publication, deployment, infrastructure, billing, production data, live execution, or merge included. Cost:
$0.Integration
NRCL-66 precedes NRCL-67 and NRCL-68. This PR must land before cross-runtime contract and Vaticor wheel-consumption work begins.