Skip to content

Add contract CLI command#52

Merged
pengfei-threemoonslab merged 2 commits intomainfrom
codex/add-contract-command
May 8, 2026
Merged

Add contract CLI command#52
pengfei-threemoonslab merged 2 commits intomainfrom
codex/add-contract-command

Conversation

@pengfei-threemoonslab
Copy link
Copy Markdown
Contributor

@pengfei-threemoonslab pengfei-threemoonslab commented May 8, 2026

Summary

Adds agents-shipgate contract --json as a local runtime contract command for coding agents. The new payload is versioned with contract_version: "1" and sources CLI/report/packet versions from the same runtime constants used by the package and schema/report generation.

Changes

  • Adds agents_shipgate.contract with ContractPayload, contract constants, and build_contract_payload().
  • Registers agents-shipgate contract --json in the Typer CLI and self-check surface probe.
  • Updates STABILITY.md, the keystone agent contract doc, .well-known metadata, prompts, skill/slash-command surfaces, and target-repo snippets to prefer local contract verification.
  • Fixes stale agent-facing packet schema references from v0.2 to the current v0.3.
  • Adds tests for the CLI payload, human-output smoke coverage, manual_review_signals[] field-path resolution, self-check surface, and public-surface drift consistency against runtime model defaults.
  • Documents manual_review_signals[] dotted-path notation and old-install fallback behavior for prompts.

Validation

  • python -m ruff check .
  • python -m pytest (551 passed)
  • git diff --check

@pengfei-threemoonslab pengfei-threemoonslab changed the title [codex] Add contract CLI command Add contract CLI command May 8, 2026
@pengfei-threemoonslab pengfei-threemoonslab marked this pull request as ready for review May 8, 2026 21:53
@pengfei-threemoonslab pengfei-threemoonslab merged commit fd4b1bd into main May 8, 2026
1 check passed
pengfei-threemoonslab added a commit that referenced this pull request May 8, 2026
Resolves conflicts in three files:

- docs/agent-contract-current.md: keeps main's new
  `agents-shipgate contract --json` verification block and
  `Runtime contract: 1` line on top of this branch's
  `Latest release: v0.10.0` bump.
- skills/agents-shipgate/SKILL.md: keeps main's new
  `Installed CLI contract` bullet pointing at the local
  `agents-shipgate contract --json` command, alongside this
  branch's consolidated `Report JSON` bullet that links the
  long field enumeration into
  docs/agent-contract-current.md instead of restating it.
- tests/test_public_surface_contract.py: takes main's broader
  `ANY_PACKET_SCHEMA_PATTERN` regex (`v\d+\.\d+`, future-proof
  past v0.x) and keeps this branch's three new patterns
  (LEGACY_PACKET_SCHEMA_PATTERN, PACKET_ANCHOR_PATTERN, plus
  the action/pip/version-input pin patterns).

Auto-merged everything else cleanly, including .well-known
(this branch's v0.10.0 bump + main's new `contract` and
`contract_version` keys).

Verification: pytest 677 passed, ruff clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pengfei-threemoonslab added a commit that referenced this pull request May 8, 2026
Picks up: contract CLI command (#52), v0.10.0 release tag (#53),
init --agent-instructions (#54), HITL evidence provenance (#50),
agent autofix-boundary docs (#55), packet schema v0.3.

Conflict resolution: kept v0.11 report-schema references on top of
main's v0.10.0 release / packet-schema v0.3 / contract-command
additions. AGENTS.md and SKILL.md adopt main's centralized
"contract lives in agent-contract-current.md" pattern; the v0.11
provenance line lives there now. test_public_surface_contract.py
adopts main's derive-from-model approach for the current schema
constants and just adds v0.10 to the legacy-pattern list.

Also fixes a SARIF regression flagged in review: ``_location()``
chose the structured branch whenever ``source.path`` was set, so a
finding with ``path="foo.py"`` and legacy
``location="foo.py:10"`` emitted no ``region``. Hybrid / plugin
findings now fall back to ``_split_location(source.location or
source.ref)`` when ``start_line`` is absent. Adds a regression
test.

After merge: 805 passed (+3 skipped), ruff clean,
``agents-shipgate contract --json`` reports
``report_schema_version: "0.11"``.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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