Skip to content

fix: Expose safe IAM read failure diagnostics - #717

Merged
Pigbibi merged 1 commit into
mainfrom
fix/paper-iam-safe-diagnostics
Nov 6, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
fix/paper-iam-safe-diagnostics

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and change

The IAM script hides every failure behind one generic diagnostic. Emit only a literal allowlisted Blocked category and read phase (token acquisition, role GET, getIamPolicy), with a fixed unknown fallback. Convert token subprocess failures to a fixed authentication category without exposing stderr.

Authority checks, dry-run/apply gates, mutation logic, exit status 1, single-attempt requests and no-retry behavior are preserved. Only the script and its offline tests change. No workflow dispatch, IAM operation, environment/secret update or PAPER start was performed.

Validation

  • Tests first: 30 new diagnostic cases failed before the fix; 26 existing cases passed.
  • Focused suite: 56 passed, including hostile exception text, unknown category/phase, subprocess stderr/timeout/executable failure, invalid tokens, HTTP rejection, transport failure and invalid JSON in each remote read phase.
  • Frozen environment (uv sync --frozen --extra test): full pytest suite 3172 passed, 1 skipped, 431 subtests passed; Ruff passed; Node contracts 11 passed; diff check passed; documentation check 0 blocking / 1 existing advisory.
  • Initial full run using a reused environment failed because its installed UES revision differed from uv.lock; the isolated locked environment above resolved those failures.
  • AST comparison confirms authority gates, role/policy validation and the entire execute function (including mutations) are unchanged.
  • Central checker: publication-check/2.0-advisory, build 83d9d1130377; complete tracked tree findings=1487, matching lines=1476. Advisory scan; changed-file findings=8, all in existing code/fixtures. No new matching lines were added. These matches do not establish credential content.

First 20 central-checker matches (shared-masker output):

[
  {
    "file": ".env.example",
    "line": 21,
    "text": "TELEGRAM_TOKEN=<<HOST>>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 7,
    "text": "/.env.example @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 8,
    "text": "/.github/CODEOWNERS @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 9,
    "text": "/.github/workflows/ @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 10,
    "text": "/application/account_new_risk_gate_support.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 11,
    "text": "/application/durable_execution_commands.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 12,
    "text": "/application/execution_receipt_adapter.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 13,
    "text": "/application/execution_service.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 14,
    "text": "/application/execution_state.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 15,
    "text": "/application/longbridge_execution.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 16,
    "text": "/application/paper_execution_command_consumer.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 17,
    "text": "/application/paper_strategy_risk_state.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 18,
    "text": "/runtime_execution_policy.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/CODEOWNERS",
    "line": 19,
    "text": "/scripts/execution_report_heartbeat.py @<PROJECT_ID>"
  },
  {
    "file": ".<PROJECT_ID>/dot-review/review.cjs",
    "line": 106,
    "text": "  const token = <REDACTED> core.getIDToken(audienceText); // Exact bytes; URL normalization may change an audience."
  },
  {
    "file": ".<PROJECT_ID>/dot-review/review.cjs",
    "line": 190,
    "text": "  const <PROJECT_ID> = {...pr,head:{...pr.head,sha:pair.target},base:{...pr.base,sha:pair.base}};"
  },
  {
    "file": ".<PROJECT_ID>/dot-review/review.cjs",
    "line": 191,
    "text": "  const binding = {...b.binding({repository:trust.repo.full_name,pr:<PROJECT_ID>,policyCommit:trust.commit,files},trust.policySha),"
  },
  {
    "file": ".<PROJECT_ID>/dot-review/test-review.cjs",
    "line": 81,
    "text": "  const content='<PROJECT_ID> source\\n', sourceSHA='d'.repeat(40);"
  },
  {
    "file": ".<PROJECT_ID>/dot-review/test-review.cjs",
    "line": 82,
    "text": "  const pr={number:7,changed_files:1,commits:1,title:'<PROJECT_ID> change',body:'<PROJECT_ID> body',"
  },
  {
    "file": ".<PROJECT_ID>/dot-review/test-review.cjs",
    "line": 100,
    "text": "    assert.equal(audience,'https://audience.example.test');return '<PROJECT_ID>-only';},summary};"
  }
]

Risk and limits

Diagnostics only; the prior remote failure remains unproven until a separately authorized future dry-run. This Draft grants no merge or execution authority. No labels or merge request are part of this job.

AI assistance

Codex, gpt-6.1-sol, implemented and verified this bounded diagnostic change.

@Pigbibi

Pigbibi commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 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-11-06T12:09:48.305972Z c481c31 Draft marked ready
ℹ️ 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: c481c3140c

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

@Pigbibi
Pigbibi marked this pull request as ready for review November 6, 2026 12:08
@Pigbibi Pigbibi added the agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation label Nov 6, 2026
@Pigbibi
Pigbibi merged commit 512cca8 into main Nov 6, 2026
15 of 18 checks passed
@Pigbibi
Pigbibi deleted the fix/paper-iam-safe-diagnostics branch November 6, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant