Skip to content

Extract runtime facade compatibility layer from PR 188 - #213

Merged
mindfn merged 5 commits into
mainfrom
codex/pr212-runtime-facades-main
Mar 12, 2026
Merged

Extract runtime facade compatibility layer from PR 188#213
mindfn merged 5 commits into
mainfrom
codex/pr212-runtime-facades-main

Conversation

@mindfn

@mindfn mindfn commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • re-cut the runtime facade compatibility work from the old stacked PR onto main
  • restore public facade exports for checkpoint, embedding, event, hook, plan, security, and transport through defaults / adapters modules
  • keep the checkpoint/security compatibility fixes and facade-focused regression coverage while excluding the obsolete compression/context baseline changes

Verification

  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/python -m pytest -q tests/unit/test_package_initializers_facade_pattern.py tests/unit/test_checkpoint_defaults.py tests/unit/test_security_boundary.py tests/unit/test_transport_typed_payloads.py tests/unit/test_transport_channel.py tests/unit/test_react_agent_gateway_injection.py
  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/python -m pytest -q

Notes

Re-cut the runtime facade compatibility work from the old stacked PR onto the current main branch after PR 211 merged.

Key changes:
- restore public facade exports for checkpoint, embedding, event, hook, plan, security, and transport through defaults/adapters modules instead of direct _internal imports
- preserve permissive security boundary compatibility and deep-copy checkpoint payload snapshots for stable round-trips
- bring over the facade-focused regression coverage and min-surface review note
- intentionally exclude the old stacked PR's compression/context baseline implementation changes

Rationale:
The previous PR 212 was stacked on an outdated pre-merge PR 211 base and still carried obsolete compression/context commits. This commit rebuilds the intended facade/checkpoint scope directly on top of main so the PR can be reviewed and merged independently.
@mindfn

mindfn commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator 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: 8c82ca754c

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +265 to +269
class DefaultSecurityBoundary(LegacyDefaultSecurityBoundary):
"""Permissive default boundary with legacy `from_config()` compatibility."""

@classmethod
def from_config(cls, config: dict[str, Any] | None) -> PolicySecurityBoundary:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve policy semantics for impl DefaultSecurityBoundary

Changing dare_framework.security.impl.DefaultSecurityBoundary from an alias of PolicySecurityBoundary to a subclass of the permissive legacy boundary is a behavioral regression for existing impl imports: DefaultSecurityBoundary() now allows high-risk actions by default and no longer accepts policy constructor kwargs (it raises TypeError), whereas before it inherited full policy-gate behavior and constructor compatibility. This can silently disable approval/deny enforcement in deployments that instantiate this symbol from security.impl.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Already covered by 2c0cbe6 on this branch. dare_framework.security.impl.DefaultSecurityBoundary is back to the PolicySecurityBoundary alias, the permissive public baseline stays behind the public facade, and tests/unit/test_security_boundary.py now exercises both the from_config(...) and direct constructor paths for the impl import.

Fresh verification:

  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/python -m pytest -q tests/unit/test_security_boundary.py tests/unit/test_package_initializers_facade_pattern.py -> 9 passed

Address the PR 213 review finding around  semantics.

Key changes:
- restore  as the policy-boundary alias so existing impl imports keep constructor kwargs and approval/deny behavior
- add  to expose the permissive public baseline boundary without routing the package initializer through
- update the public security facade to import  from the new defaults module
- add regression coverage proving the impl constructor path still behaves like

Rationale:
The previous refactor conflated the public permissive facade with the historical  alias and changed behavior for deployments that import from . This split preserves both compatibility layers with their original semantics.
@mindfn

mindfn commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator Author

Handled in 2c0cbe6.

This preserves the old two-layer contract instead of conflating them:

  • dare_framework.security.impl.DefaultSecurityBoundary is restored to the PolicySecurityBoundary alias, so existing impl imports keep policy-gate semantics and constructor kwargs compatibility
  • the permissive public baseline now lives behind dare_framework.security.defaults.DefaultSecurityBoundary, and dare_framework.security re-exports that public facade
  • tests/unit/test_security_boundary.py now covers the direct impl constructor path as a regression

Verification:

  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/python -m pytest -q tests/unit/test_security_boundary.py tests/unit/test_package_initializers_facade_pattern.py -> 9 passed
  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/python -m pytest -q -> 751 passed, 12 skipped, 1 warning

@mindfn

mindfn commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mindfn

mindfn commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator Author

Re-checked the inline security-boundary comment against the current PR head. The branch already carries the 2c0cbe6 fix that restores dare_framework.security.impl.DefaultSecurityBoundary to policy semantics and keeps the permissive baseline behind the public facade.

Fresh verification:

  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/python -m pytest -q tests/unit/test_security_boundary.py tests/unit/test_package_initializers_facade_pattern.py -> 9 passed

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Resolve the remaining package initializer conflicts after merging origin/main into codex/pr212-runtime-facades-main.\n\nKeep the facade/defaults exports introduced by this branch in the affected package __init__ modules, retain the incoming mainline updates across the rest of the tree, and verify the combined result with the full pytest suite.
@mindfn

mindfn commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator Author

Merged the latest origin/main into codex/pr212-runtime-facades-main and resolved the remaining package-initializer conflicts by keeping the facade/defaults exports introduced by this branch in the affected __init__ modules.

Verification:

  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/pytest -q tests/unit/test_package_initializers_facade_pattern.py tests/unit/test_checkpoint_defaults.py tests/unit/test_security_boundary.py tests/unit/test_transport_typed_payloads.py tests/unit/test_transport_channel.py tests/unit/test_react_agent_gateway_injection.py -> 49 passed, 1 warning
  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/pytest -q -> 775 passed, 12 skipped, 1 warning

Conflict-resolution merge commit: 727b587.

@mindfn

mindfn commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator 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: 727b587284

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +173 to +174
if "current_milestone_idx" in payload and hasattr(state, "current_milestone_idx"):
state.current_milestone_idx = payload["current_milestone_idx"]

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 Restore task/run identifiers from session-state payload

SessionStateContributor.serialize() includes task_id and run_id in the checkpoint payload, but deserialize_and_apply() only writes back current_milestone_idx. When a checkpoint is restored into a new or reset session object, the execution resumes with stale identifiers, which can break continuity for metadata keyed by task/run IDs even though those IDs were captured in the snapshot.

Useful? React with 👍 / 👎.

Restore task_id and run_id when SessionStateContributor reapplies serialized session state during checkpoint recovery.\n\nThis preserves the identifiers emitted by serialize(), avoids stale session metadata after restore, and adds a regression test that exercises the direct deserialize path alongside the existing checkpoint defaults coverage.
@mindfn

mindfn commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the latest checkpoint review note from #213 (comment).

Fixed in 51554c8 on codex/pr212-runtime-facades-main:

  • SessionStateContributor.deserialize_and_apply() now restores task_id and run_id alongside current_milestone_idx
  • added regression coverage in tests/unit/test_checkpoint_defaults.py for checkpoint restore into a session state with stale identifiers

Verification:

  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/pytest -q tests/unit/test_checkpoint_defaults.py -> 7 passed

@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: 51554c8e58

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread dare_framework/checkpoint/defaults.py Outdated
Message(
role=item.get("role", "user"),
kind=item.get("kind", "chat"),
text=item.get("text") or item.get("content", ""),

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 Preserve null message text during STM restore

StmContributor.serialize() writes the original Message.text value (which can validly be None), but restore uses item.get("text") or item.get("content", ""), so any saved None is coerced to "". This mutates checkpoint round-trips (e.g., tool/result messages created with text=None) and can change downstream behavior that distinguishes missing text from empty text.

Useful? React with 👍 / 👎.

Preserve explicit None message text when StmContributor restores serialized STM payloads during checkpoint recovery.\n\nDifferentiate between checkpoints that intentionally saved text=None and legacy payloads that only exposed content, so tool/result messages round-trip without being coerced into empty strings. Add regression coverage for the null-text checkpoint case alongside the existing checkpoint defaults tests.
@mindfn

mindfn commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the latest STM checkpoint review note from #213 (comment).

Fixed in 6949af2 on codex/pr212-runtime-facades-main:

  • StmContributor.deserialize_and_apply() now preserves explicit text=None values from serialized payloads
  • legacy payloads without a text field still fall back to content, so backward compatibility stays intact
  • added regression coverage in tests/unit/test_checkpoint_defaults.py for a TOOL_RESULT message round-tripping with text=None

Verification:

  • /Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/pytest -q tests/unit/test_checkpoint_defaults.py -> 8 passed

@mindfn

mindfn commented Mar 12, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mindfn
mindfn merged commit 43e2398 into main Mar 12, 2026
3 of 11 checks passed
@mindfn
mindfn deleted the codex/pr212-runtime-facades-main branch March 12, 2026 03:20
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