Skip to content

feat(kernel): define stable Neural surface (NRCL-66) - #25

Merged
hudsonaikins merged 2 commits into
mainfrom
codex/nv-010-stable-kernel
Jul 30, 2026
Merged

feat(kernel): define stable Neural surface (NRCL-66)#25
hudsonaikins merged 2 commits into
mainfrom
codex/nv-010-stable-kernel

Conversation

@hudsonaikins

Copy link
Copy Markdown
Contributor

Outcome

Defines the narrow, dependency-free Neural kernel surface required by Plane story NRCL-66 and the accepted Neural + Vaticor Launch Blueprint v3.

Changes

  • adds neural.kernel as the stable import boundary
  • adds machine-readable stable, experimental, and deprecated capability metadata
  • adds deterministic fixture replay with a golden SHA-256 digest
  • adds neural --json replay demo and kernel capability output
  • extends installed-artifact smoke validation to exercise replay from a wheel installed with --no-deps
  • documents compatibility, extras, deprecation, and no-live-authority boundaries in Fumadocs
  • preserves existing experimental and deprecated import paths

Acceptance

  • stable/experimental capability matrix and compatibility policy are durable
  • base-wheel import loads no optional runtime stack
  • installed wheel completes deterministic replay
  • deprecated and extra-gated surfaces retain documented compatibility paths
  • exact candidate, wheel digest, Python matrix, and evidence record exist

Exact candidate

  • Head: 11b8b9a91f0e4038ea726e9097fbb2b65914bfe1
  • Base: bebd35375e382c8e82e268e3225e63989a44e138
  • Branch: codex/nv-010-stable-kernel

Validation

  • uv run --extra dev ruff check . — passed
  • changed-surface Black check — passed
  • uv run --extra dev mypy neural — passed, 70 source files
  • uv run --extra dev pytest -q — 124 passed, 6 skipped
  • uv lock --check — passed
  • documentation validator — passed
  • Fumadocs typecheck and production build — passed, 42 static pages
  • installed-wheel smoke with --no-deps — passed on Python 3.10, 3.11, and 3.12
  • replay digest on every version: 569f87947428d4d093425134181b754ca974675aa7c74fc2cb73a8e193f5b4e6
  • wheel SHA-256: 4a99ded9e1ce6382abb1923272fb229b08094eef92f72930b7338446f59ed54c

Risk 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.

@makeplane

makeplane Bot commented Jul 30, 2026

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

📚 Documentation Status

✅ Code changes detected

  • Docstring coverage checked
  • API documentation validation completed
    ✅ Documentation changes detected
  • Documentation structure validated
  • Links checked for broken references
    ✅ README changes detected

This comment is automatically generated by the documentation workflow.

@hudsonaikins
hudsonaikins marked this pull request as ready for review July 30, 2026 01:45
@hudsonaikins

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread neural/kernel/replay.py Outdated
def _event_sort_key(event: ReplayEvent) -> tuple[str, str, str, str, str, str]:
payload = event.as_dict()
return (
payload["observed_at"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 200828bb0af75e219dc43f5b41da7f28a82ae55b: replay ordering now uses parsed UTC datetimes. Added a fractional-second regression proving the latest observation wins.

Comment on lines +45 to +46
if result.get("market_count") != 2:
raise ReleaseSmokeError("kernel replay market count changed")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 200828bb0af75e219dc43f5b41da7f28a82ae55b: installed-artifact smoke now requires the exact two-market snapshot and latest prices. Added a rejection test for an empty snapshot.

Comment thread neural/kernel/replay.py Outdated


def _decimal_text(value: Decimal) -> str:
normalized = value.normalize()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 200828bb0af75e219dc43f5b41da7f28a82ae55b: decimal serialization no longer calls context-sensitive normalize(). Added a precision-1 regression proving digest and payload stability.

@hudsonaikins

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 200828bb0a

ℹ️ 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".

@hudsonaikins
hudsonaikins merged commit 5d30d1c into main Jul 30, 2026
9 checks passed
@hudsonaikins
hudsonaikins deleted the codex/nv-010-stable-kernel branch July 30, 2026 02:10
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