Skip to content

feat(examples): add Invoice Desk fixture and OpenAI PR scans - #1144

Merged
mldangelo-oai merged 19 commits into
mainfrom
mdangelo/codex/invoice-desk-ci
Oct 1, 2026
Merged

mldangelo-oai merged 19 commits into
mainfrom
mdangelo/codex/invoice-desk-ci

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add Invoice Desk, a local application with synthetic data and ten intentional security scenarios for scanner QA. When GitHub delivers an eligible event, PRs targeting main queue a protected OpenAI scan of the application's exact source revision. Maintainers can use the same protected workflow to dispatch a PR scan manually if automatic events do not arrive. Findings are report-only; scan failures fail the scan job.

Changes

  • Add the dependency-free Node.js application, behavior checks, QA manifest, and threat model. Keep the QA guide and expected findings outside the application directory used for scanning.
  • Dispatch scans from trusted workflow code on protected main, including a fallback for completed PR test runs. Reuse the same PR/head dispatch key so fallback runs can recognize an earlier scan.
  • Isolate cancellation by PR and source revision before package preparation, then check eligibility again after environment approval. Extract committed application blobs without running PR code, then remove both full checkouts before inference.
  • Cache public CLI package downloads in a trusted preparation job. Give the inference job read-only cache access and fresh authentication and analysis state.
  • Save reports, SARIF, coverage, usage, and timing measurements for seven days. Keep missing measurements and recall unknown.
  • Simplify the setup and reporting guides, name the invoice preview dialog for assistive technology, and use one readable muted-text palette. Darken status labels while retaining their distinct colors.
  • Merge current main and satisfy its blocking workflow checks: call the installed CLI by its path, document the reviewed trigger exceptions, and scope the actionlint exception to GitHub's supported cache permissions.

Testing

  • Hosted node-ci passed on 00a9608: 45 jobs passed and one was skipped.
  • node --test .github/scripts/invoice-desk-source.test.mjs .github/scripts/invoice-desk-target.test.mjs: 18 passed, including repeated fallback dispatches.
  • On 00a9608, 17 mocked workflow tests passed (eight new Invoice Desk cases and nine existing example cases). They execute the workflow scripts with synthetic CLI results to check arguments, exit/output handling, missing-key behavior, SARIF gating, metrics, and required artifacts. Types, formatting, and git diff --check passed.
  • Four selected ordinary application checks passed: standalone startup, preview refresh, pages/assets/health, and logout.
  • The muted-text and status-label foreground/background pairs exceed 5:1 contrast, including the login background. Prettier on edited files and git diff --check passed.
  • Actionlint 1.7.12 with ShellCheck 0.11.0 and zizmor 1.30.1 passed across the repository workflows. The narrow actionlint exception preserves GitHub's job-level cache permissions.
  • Three fresh native reviews and independent verification of 00a9608 completed with no findings.
  • Two workflow-selection and required-check regression tests passed after merging main.
  • Hosted inference and automatic dispatch require the workflows on main and protected environment approval; they have not been run as part of this cleanup.

Risk and rollout

The application is deliberately insecure. Run it locally with synthetic data only; do not deploy it.

Configure invoice-desk-inference with required reviewers, a deployment rule allowing protected main, and a dedicated OPENAI_API_KEY environment secret. Review the selected source revision before approving inference. After merge, run a baseline twice to check reporting and cache reuse, then verify automatic dispatch from a PR.

An approved scan already running can finish after the PR head changes; its reports identify the scanned revision. The scan runs in a separate Actions workflow. It does not create a PR status check, Code Scanning alerts, or PR comments. A completed scan does not prove all ten cases were found; review distinct root causes before setting recall thresholds. No public CLI, SDK, or plugin API changes.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the enhancement New feature or request label Oct 1, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 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-10-01T22:28:02.262386Z 00a9608 Manual request
🔒 Security Review ✅ Completed 2026-10-01T22:28:23.616913Z 00a9608 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: 0e067a4ab6

ℹ️ 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 .github/workflows/invoice-desk.yml 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: 1971a75c08

ℹ️ 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 .github/workflows/invoice-desk.yml Outdated
Comment thread .github/workflows/invoice-desk.yml Outdated
@mldangelo-oai mldangelo-oai changed the title feat(examples): add Invoice Desk fixture and OpenAI PR scans feat(examples): add Invoice Desk fixture and approved OpenAI scans Oct 1, 2026
@mldangelo-oai mldangelo-oai changed the title feat(examples): add Invoice Desk fixture and approved OpenAI scans feat(examples): add Invoice Desk fixture and OpenAI PR scans Oct 1, 2026

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

ℹ️ 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 .github/workflows/invoice-desk-scan.yml
Comment thread .github/workflows/invoice-desk-scan.yml

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

ℹ️ 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 .github/workflows/invoice-desk-scan.yml Outdated
Comment thread .github/scripts/invoice-desk-target.mjs 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: 01f25335ed

ℹ️ 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 .github/workflows/invoice-desk-scan.yml

@soyeon-oai soyeon-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the fixture/scenario boundaries, protected-main dispatch, exact committed-blob extraction, post-approval eligibility check, checkout removal before inference, cache permissions and result reporting. No new actionable findings. Both hosted Node versions passed all 37 app/orchestration tests and node-ci passed. This is source review with hosted evidence, not independent execution; the protected inference/automatic-dispatch rollout still needs the post-merge validation described in the PR.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The fallback can miss token-created PRs and repeat paid scans for unchanged fallback targets.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
What changed in this PR

Adds Invoice Desk, a dependency-free security-scanning fixture with ten intentional vulnerabilities, behavioral QA, and protected OpenAI scan automation.

Changes:

  • Adds the sample application, threat model, QA manifest, and tests.
  • Adds trusted workflows for PR targeting, source extraction, caching, scanning, and reporting.
  • Documents local use, CI operation, and scanner evaluation.
File Description
examples/​README.md Links the new sample.
examples/​invoice-desk/​SECURITY.md Documents the threat model.
examples/​invoice-desk/​README.md Provides setup and CI guidance.
examples/​invoice-desk/​qa/​README.md Defines QA and scoring practices.
examples/​invoice-desk/​qa/​expected-findings.json Records ten seeded findings.
examples/​invoice-desk/​qa/​app.test.mjs Tests scenarios and normal behavior.
examples/​invoice-desk/​app/​views.mjs Renders application pages.
examples/​invoice-desk/​app/​store.mjs Creates synthetic in-memory data.
examples/​invoice-desk/​app/​server.mjs Implements HTTP routing.
examples/​invoice-desk/​app/​README.md Documents the standalone application.
examples/​invoice-desk/​app/​public/​styles.css Styles the interface.
examples/​invoice-desk/​app/​public/​client.js Handles browser interactions.
examples/​invoice-desk/​app/​package.json Defines runtime metadata.
examples/​invoice-desk/​app/​invoices.mjs Implements invoice workflows.
examples/​invoice-desk/​app/​integrations.mjs Implements connector behavior.
examples/​invoice-desk/​app/​imports.mjs Implements imports and policies.
examples/​invoice-desk/​app/​accounts.mjs Implements authentication and profiles.
examples/​github-actions/​README.md Documents OpenAI sample scanning.
.github/​workflows/​invoice-desk.yml Runs tests and dispatches scans.
.github/​workflows/​invoice-desk-scan.yml Performs protected source scans.
.github/​scripts/​invoice-desk-target.test.mjs Tests target resolution.
.github/​scripts/​invoice-desk-target.mjs Resolves eligible scan targets.
.github/​scripts/​invoice-desk-source.test.mjs Tests safe source extraction.
.github/​scripts/​invoice-desk-source.mjs Extracts committed application blobs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/scripts/invoice-desk-target.mjs
Comment thread .github/workflows/invoice-desk.yml
Comment thread examples/invoice-desk/app/views.mjs 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: d8b111e134

ℹ️ 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 .github/workflows/invoice-desk-scan.yml
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@mldangelo-oai
mldangelo-oai requested a balanced review from Copilot October 1, 2026 16:48

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

The protected-secret workflow and untrusted-source scan orchestration warrant final human validation despite no confirmed defects.

Review effort: Balanced
Findings: None

Resolved since last review (3)

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@mldangelo-oai
mldangelo-oai requested a balanced review from Copilot October 1, 2026 20:50
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: b5def290ad

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

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Two shared text colors fail WCAG AA contrast requirements for normal-sized text.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread examples/invoice-desk/app/public/styles.css Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@mldangelo-oai
mldangelo-oai requested a balanced review from Copilot October 1, 2026 21:23
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 9c6f25201b

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

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

It combines intentionally vulnerable code with privileged workflow dispatch, protected secrets, and hosted inference, warranting final human review.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@mldangelo-oai

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: 61bc0326e4

ℹ️ 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 .github/workflows/invoice-desk.yml

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The security-sensitive scan execution and reporting path lacks automated workflow coverage.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread .github/workflows/invoice-desk-scan.yml
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@mldangelo-oai
mldangelo-oai requested a balanced review from Copilot October 1, 2026 22:24
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 00a9608971

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

@mldangelo-oai
mldangelo-oai merged commit 619d389 into main Oct 1, 2026
14 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/invoice-desk-ci branch October 1, 2026 22:29

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

The security-sensitive workflow processes untrusted PR revisions with protected inference credentials and warrants final human validation.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@github-actions github-actions Bot mentioned this pull request Oct 1, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants