Skip to content

feat(stack): add gated progressive exposure runtime adapter - #436

Merged
8Dionysus merged 31 commits into
mainfrom
d2-tools/progressive-exposure-stack-20260826-origin
Aug 30, 2026
Merged

8Dionysus merged 31 commits into
mainfrom
d2-tools/progressive-exposure-stack-20260826-origin

Conversation

@8Dionysus

Copy link
Copy Markdown
Owner

Summary

  • Add a source-only stack adapter that normalizes the SDK progressive exposure candidate.
  • Gate materialization on the local feature flag, explicit baseline admission, candidate state, freshness, and authority ceilings.
  • Gate read-only invocation on an explicit caller authorization reference and emit content-addressed materialization/invocation receipts.
  • Keep the contour out of normal MCP registration until baseline and owner admission.

Validation

  • Progressive exposure tests: 3 passed.
  • Stack contract generator check, Ruff, and validate_stack_mcp.py passed.
  • Existing transport suites retain 3 environment failures because the installed MCP package lacks MCPServer; this is pre-existing root/runtime drift and is not changed by this source-only adapter.

Claim boundary

This PR does not authorize activation or runtime effects, prove a live endpoint, establish owner acceptance, or make economy claims. d0 baseline-ready remains required.

@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: 95b02172e8

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py

@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: 794884ba1d

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated

@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: 222deb380d

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
@8Dionysus
8Dionysus enabled auto-merge (squash) August 26, 2026 05:50
@8Dionysus

Copy link
Copy Markdown
Owner 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: 15f8424908

ℹ️ 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 tests/test_schema_contracts.py
Comment thread kag/indexes/shards/source/4a.jsonl Outdated
@8Dionysus
8Dionysus force-pushed the d2-tools/progressive-exposure-stack-20260826-origin branch from 15f8424 to 4e4374c Compare August 30, 2026 07:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-30T10:25:25.582148Z 0eddb91 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 4e4374c117

ℹ️ 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 mcp/services/abyss-stack-mcp/README.md
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated

@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: b60081f565

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py

@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: 8ddab01b4f

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py

@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: 70192b5602

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated

@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: 394a1f9b70

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py

@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: 80e2ca8439

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py

@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: 9f1cec95d4

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated

@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: d89992d345

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated

@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: 22001be757

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated

@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: 6ad17b7b00

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated

@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: 368b6f4993

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
Comment thread mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py

@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: b3060c18d9

ℹ️ 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 mcp/services/abyss-stack-mcp/src/abyss_stack_mcp/exposure.py Outdated
@8Dionysus
8Dionysus merged commit 64bdae2 into main Aug 30, 2026
2 checks passed
@8Dionysus
8Dionysus deleted the d2-tools/progressive-exposure-stack-20260826-origin branch August 30, 2026 10:25

@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: 0eddb91895

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

baseline_admission_ref: NonEmpty | None = None
activation_authorized: Literal[False] = False
execution_authorized: Literal[False] = False
contains_secrets: Literal[False] = False

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 Reject secret-bearing public receipts

When an external consumer validates a recomputed materialization receipt whose request_id or rollback_bindings contains a credential such as Bearer sk-..., this model accepts it because validation checks only field shape and the content hash; contains_secrets is fixed to false, but _reject_secret_material never runs. The published model and schema therefore accept secret-bearing receipts as secret-free, so apply the runtime's secret screening at receipt validation ingress as well.

AGENTS.md reference: AGENTS.md:L206-L207

Useful? React with 👍 / 👎.

Comment on lines +964 to +969
if authorization.issued_at > now + MAX_FUTURE_CLOCK_SKEW:
reasons.append("invocation_authorization_from_future")
if authorization.expires_at <= now:
reasons.append("invocation_authorization_expired")
if plan is not None and authorization.expires_at > plan.expires_at:
reasons.append("invocation_authorization_outlives_plan")

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 Reject authorizations predating materialization

When an authorization uses an arbitrarily old issued_at but expires after the current time and before the plan, every authorization check passes and the denial receipt records its authorization_id without an invalid-authorization reason. Such an authorization could not legitimately have been issued for the later materialization receipt, and the missing lifetime bound also permits years-long authorization windows; bind issuance to the plan/materialization time and cap authorization TTL before recording it.

Useful? React with 👍 / 👎.

Comment on lines +854 to +858
if decision == "allowed":
while len(self._materializations) >= MAX_RETAINED_MATERIALIZATIONS:
del self._materializations[next(iter(self._materializations))]
self._materializations[receipt.receipt_id] = normalized
self._emit(receipt)

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 Retain materializations only after receipt persistence

When a configured receipt_sink raises while processing an allowed materialization, the plan has already been inserted here and _emit() propagates the sink exception, so the caller receives no receipt and persistence fails while the materialization remains addressable by its deterministic receipt ID. A subsequent invoke() can therefore resolve state whose admission receipt was never successfully emitted; retain the plan only after successful emission or remove it on sink failure.

Useful? React with 👍 / 👎.

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