Files
codex-security/CONTRIBUTING.md
Michael D'AngeloandMichael D'Angelo 9534e7fd6e docs: shorten the npm package README (#2542)
* docs: shorten the npm package README

* docs: restore scan scope, CI behavior, and results guidance

---------

Co-authored-by: Michael D'Angelo <269034524+mldangelo-oai@users.noreply.github.com>
2026-11-09 21:40:18 -08:00

164 lines
15 KiB
Markdown

# Contributing
Start with the [source map](#where-to-make-a-change) for a code or documentation change. For a bug or feature request, [search existing issues](https://github.com/openai/codex-security/issues) first. Report vulnerabilities through the [security policy](SECURITY.md).
## Where to make a change
Start with the owner of the behavior, then follow its callers when the change
crosses a process, persistence, or package boundary.
| Change | Source to start with | Relevant checks |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Documentation | [User guides](docs/), [SDK and CLI guides](sdk/typescript/docs/sdk.md), and [examples](examples/README.md) | Run `node sdk/typescript/scripts/check-markdown.mjs` after [installing the SDK dependencies](sdk/typescript/TESTING.md#install-dependencies). Check examples from their stated working directory. |
| Plugin instructions | [Skills](plugins/codex-security/skills/) and shared [references](plugins/codex-security/references/) | [Portable plugin source checks](AGENTS.md#keep-it-simple) |
| Artifact contracts and generated SDK models | [Contract definitions](plugins/codex-security/mcp-app/src/artifact-contracts.ts), [canonical exports](plugins/codex-security/mcp-app/scripts/canonical-schemas.mts), and [model generator](sdk/typescript/scripts/generate-models.cjs) | [Canonical contract tests](plugins/codex-security/mcp-app/tests/test_canonical_artifact_contracts.ts), [MCP wire tests](plugins/codex-security/mcp-app/tests/test_compact_artifact_wire.ts), and [schema generation checks](#how-this-repository-works) |
| Deep Scan scheduling and workers | Shared [engine, coordinator, and executor](plugins/codex-security/mcp-app/src/deep-scan/), used by the MCP server and SDK launcher | [MCP tests](plugins/codex-security/mcp-app/tests/) and [direct SDK integration](sdk/typescript/tests-ts/direct-deep-scan.test.ts) |
| Durable scan state, checkpoints, and completion | [Python workbench](plugins/codex-security/scripts/workbench_db.py) and [Deep Scan persistence](plugins/codex-security/scripts/deep_scan_workbench.py) | [Python tests](plugins/codex-security/tests/) and [SDK workbench integration](sdk/typescript/tests-ts/deep-scan-workbench.test.ts) |
| Helper routing and stored-finding operations | SDK [runtime routing](sdk/typescript/src/runtime.ts), plugin [helper entrypoint](plugins/codex-security/mcp-app/helpers-main.ts), and [Node workbench commands](plugins/codex-security/mcp-app/src/workbench/commands.ts) | [SDK runtime tests](sdk/typescript/tests-ts/runtime.test.ts) and [MCP workbench tests](plugins/codex-security/mcp-app/tests/) |
| Public CLI and SDK behavior | [CLI adapter](sdk/typescript/src/cli.ts), [SDK API](sdk/typescript/src/api.ts), and adjacent modules | [SDK tests](sdk/typescript/tests-ts/) and the [installed-package checks](sdk/typescript/TESTING.md) |
| Markdown report rendering | [Scan report projection](plugins/codex-security/scripts/report_projection.py) and [threat-model projection](plugins/codex-security/scripts/threat_model_projection.py) | [Report tests](plugins/codex-security/tests/test_report_projection.py) and [threat-model tests](plugins/codex-security/tests/test_threat_model_projection.py) |
| Native filesystem and process operations | [Native bindings and adapters](plugins/codex-security/native/README.md) | The native guide's platform proofs and package checks |
| Packaged plugin contents | [Plugin manifest](plugins/codex-security/plugin-files.json) and [SDK plugin builder](sdk/typescript/scripts/build-plugin.mjs) | [Package inspection and installed consumers](sdk/typescript/TESTING.md) |
The SDK routes selected stored-finding and classification commands to the Node
helper; scan lifecycle commands still use the Python workbench. Trace the
specific command before changing either implementation. Shared Deep Scan
behavior belongs in the plugin engine, with adapter changes in the MCP server
or SDK only when their entrypoint behavior differs.
## How this repository works
`plugins/codex-security/` is the canonical source for the Codex Security
plugin. Make plugin changes there.
To inspect the bundled npm plugin, [download the native package inputs](plugins/codex-security/native/README.md#package-inputs), then run `pnpm --dir sdk/typescript run build:plugin` from the repository root. The build writes `sdk/typescript/_bundled_plugin/`. Packaging also generates this directory during `prepack`. Edit the plugin source and leave generated files out of commits.
Compact artifact contracts are authored in `plugins/codex-security/mcp-app/src/artifact-contracts.ts`, with shared finding and threat-model definitions in `finding-detail-schemas.ts` and `threat-model-schema.ts`.
Canonical findings, scan-manifest, and coverage exports are defined in `mcp-app/scripts/canonical-schemas.mts`; patch-risk exports and their static type are defined in `mcp-app/src/patch-risk-schema.ts`.
The corresponding JSON schemas are generated compatibility resources. Canonical runtime validation continues to use the selected plugin's JSON schemas.
Model-facing MCP schemas are projected by [`artifact-schema-loader.ts`](plugins/codex-security/mcp-app/src/artifact-schema-loader.ts).
After editing the contracts, run `node plugins/codex-security/mcp-app/scripts/generate-artifact-schemas.mjs`.
The MCP `typecheck` command checks that the generated resources are current. SDK model generation remains based on the canonical JSON exports.
`pnpm --dir sdk/typescript run generate:models` also copies workbench argument
encoding and executable path handling from the plugin source into the SDK. Edit the
plugin helper, then regenerate its SDK copy. Historical finding normalization is
maintained in the SDK.
`pnpm --dir sdk/typescript run types` checks freshness.
The SDK build reads Deep Scan setting names from
`plugins/codex-security/mcp-app/src/deep-scan-settings.ts`. If you build the
SDK from a sparse checkout, include this file alongside the plugin defaults
and severity rubric.
Model-based evaluations live in [`evals/`](evals/README.md), outside the plugin
source. CI runs deterministic triage checks and the Deep Scan iteration and
publication tests in the MCP suite.
See the [CI guide](docs/ci.md) for check selection, platform/version coverage,
required status checks, and test-runner qualification.
## Support for open-source projects
If you maintain an open-source project,
[open an issue](https://github.com/openai/codex-security/issues/new) with the
repository, your role, and what you need. Support is best effort. Scan only
repositories you trust and either own or have permission to assess.
## Report a bug
Include your CLI or SDK version, operating system, reproduction steps, and
the expected and observed behavior. Remove credentials, private code,
customer data, and security findings before posting.
## Suggest a feature or improve the documentation
Open an issue describing the problem and the workflow you want to support.
Use synthetic examples that contributors can reproduce and share publicly.
## Report a security issue
Report Codex Security vulnerabilities privately as described in
[SECURITY.md](SECURITY.md). Do not post vulnerabilities, exploit details,
credentials, or sensitive scan results publicly.
If a scan finds a vulnerability in another project, report it to that
project's maintainers through their security policy.
## Pull request labels
Keep pull request labels focused on release behavior and material platform
impact. Do not apply `area:*` labels to pull requests; describe the affected
surface in the title and description. Issues retain their existing area,
priority, and status labels. Existing maintainer triage labels can remain on
pull requests while they identify actionable, unresolved work.
Preserve the release labels `bug`, `enhancement`, `documentation`,
`breaking-change`, and `skip-release-notes`, including maintainer overrides.
Follow their [release-note and version semantics](RELEASING.md). Do not replace
manual `breaking-change` or `skip-release-notes` labels based only on the title.
Use `platform:windows` only when Windows-specific behavior is material to the
change. Dependabot uses `dependencies` across all package ecosystems. Labels
are not required to open, test, review, or merge a pull request.
## Testing plugin connectors
For changes to [Jira intake or tracking](docs/plugin-connectors.md), use synthetic findings in a designated QA project.
1. Verify the site, account and selected connection. Read a synthetic issue by key and through a project-scoped JQL search that spans more than one page.
2. Track a finding through the Atlassian app. Create an issue, repeat the operation to verify reuse, then update the approved fields. Read the issue back after each write and check for duplicates.
3. Try a missing connection and an account with insufficient access. Check that each failure explains how to recover and leaves the project without duplicate issues.
Record live checks separately from static tests. Keep account and project details, issue keys and raw tool responses private. Report product vulnerabilities through [SECURITY.md](SECURITY.md).
## Investigate a CI failure
Open the `node-ci` run for the PR revision that failed. The `ci` job reports
the overall result. Open the failing build, test shard, or validation job to
find the original error. If a later attempt passed, use the run's attempt
selector to inspect the first failure. From the command line,
`gh run view RUN_ID --attempt 1 --log-failed` shows that attempt's failed steps.
For a transient infrastructure failure, rerun the failed jobs after checking
the original logs. For a failed assertion, reproduce it on the reported
platform with the logged seed when available. See the [CI guide](docs/ci.md)
for check selection and the [SDK testing guide](sdk/typescript/TESTING.md)
for local reproduction.
## Dependency and release maintenance
Maintainers update package dependencies and committed lockfiles with the
affected source. The public release workflow installs those locked graphs,
tests the package, and publishes a verified artifact with npm provenance.
GitHub Actions dependencies are maintained separately in this repository.
Workflow and composite-action changes run `workflow-quality` through
`node-ci`. actionlint validates workflow syntax, and ShellCheck
checks shell scripts in workflow `run` steps for warnings and errors. zizmor's
offline checks at medium severity and above cover workflows and composite
actions. The pinned tool versions are in `.github/workflows/workflow-quality.yml`;
run these checks locally with:
```bash
SHELLCHECK_OPTS=--severity=warning actionlint
zizmor --offline --strict-collection --min-severity medium --config .github/zizmor.yml .github
```
The actionlint configuration preserves GitHub's supported release queue and
job-level cache syntax until the linter supports them. The zizmor configuration
records reviewed privileged triggers and their trust boundaries. Review these
exceptions when changing the affected workflows.
CI package builds and npm release validation require the production dependency
audit to pass. Run it locally with `pnpm --dir sdk/typescript run audit:prod`.
The existing policy checks production dependencies at the high-severity threshold.
Resolve high or critical advisories, or audit service failures, before retrying.
[GitHub Releases](https://github.com/openai/codex-security/releases) is the
canonical changelog. Maintainers should follow [RELEASING.md](RELEASING.md) to
prepare, publish, verify, or repair a release.
See the [SDK testing guide](sdk/typescript/TESTING.md) for local checks,
test conventions, and the required and experimental CI jobs.