Skip to content

feat: portfolio sprint 2 — principal-grade artifacts and supply-chain hardening#41

Merged
tafreeman merged 2 commits into
mainfrom
claude/elegant-leavitt-dc490e
May 12, 2026
Merged

feat: portfolio sprint 2 — principal-grade artifacts and supply-chain hardening#41
tafreeman merged 2 commits into
mainfrom
claude/elegant-leavitt-dc490e

Conversation

@tafreeman
Copy link
Copy Markdown
Owner

Summary

  • PB-02 — 3 MADR-format Architecture Decision Records extracted from planning docs, with a proper index: protocols over ABC, flat layout over src/, single Provider over adapter matrix
  • PB-08requirements.lock (30 pinned packages via uv pip compile) + pip-audit step in the CI security job; no vulnerabilities found
  • PB-09 — New .github/workflows/codeql.yml running CodeQL SAST with security-extended queries on push/PR/weekly schedule
  • PB-10sbom.json (CycloneDX 1.6, 372 components) committed to root; publish.yml regenerates it on each release tag
  • PB-11 — Already done (OIDC trusted publishing was in place; confirmed and left intact)
  • PB-15 — Removed examples/ from mypy --strict exclusion; fixed 5 type errors and 3 ruff issues in react_tool_use.py

Why

Sprint 2 goal from dev/PORTFOLIO_BACKLOG.md: "Principal-grade artifacts are now discoverable and supply-chain posture is documented." A director-level reviewer landing on this repo can now find:

  1. Formal ADRs explaining key design decisions (not just code)
  2. A pinned dependency lockfile with automated vulnerability scanning
  3. SAST via CodeQL (free on public repos) in addition to existing Bandit
  4. A CycloneDX SBOM demonstrating OWASP SCVS / supply-chain awareness
  5. Fully-typed example scripts they can copy-paste with confidence

Test plan

  • pytest tests/ -m "not integration" — 387 passed, 85% coverage (threshold: 80%)
  • mypy --strict executionkit/ examples/ — 0 errors across 26 source files
  • ruff check executionkit/ tests/ examples/ — all checks passed
  • pip-audit --requirement requirements.lock — no known vulnerabilities
  • sbom.json valid JSON, CycloneDX 1.6 format, 372 components

Files changed

File Change
docs/adr/001-structural-protocols.md New — MADR ADR
docs/adr/002-flat-layout.md New — MADR ADR
docs/adr/003-single-provider.md New — MADR ADR
docs/adr/README.md Replace placeholder stub with index table
requirements.lock New — 30 pinned packages
sbom.json New — CycloneDX 1.6 SBOM
.github/workflows/codeql.yml New — CodeQL SAST workflow
.github/workflows/ci.yml Add pip-audit step to security job
.github/workflows/publish.yml Add SBOM generation to build job
pyproject.toml Remove examples/ from mypy exclude
examples/react_tool_use.py Fix mypy + ruff issues

🤖 Generated with Claude Code

knowlesjim287-bot and others added 2 commits May 11, 2026 15:36
- Delete raw AI session transcripts and binary planning files (convo.txt,
  chatgpt covo.txt, Repo Name Suggestions.docx/.pdf) from dev/planning/
- Archive dev/planning/ → docs/planning/ with historical-context README
- Relocate .full-review/ → docs/review-process/; gitignore state.json
- Add PORTFOLIO.md: stack context, where to start, design decisions, CI facts
- Add README "For Reviewers" section linking arch.md, anti-scope, examples
- Add docs/adr/README.md stub (Sprint 2 will populate with 3 ADRs)
- Add dev/PORTFOLIO_BACKLOG.md: 16-item sprint-planned portfolio backlog
- Strip 57 redundant @pytest.mark.asyncio decorators (asyncio_mode=auto)

387 tests pass, 85% coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… hardening

ADRs (PB-02):
- docs/adr/001-structural-protocols.md: PEP 544 protocols over ABC
- docs/adr/002-flat-layout.md: flat layout over src/ wrapper
- docs/adr/003-single-provider.md: single OpenAI-compatible Provider over adapter matrix
- docs/adr/README.md: replace placeholder stub with proper index table

Supply-chain security:
- requirements.lock: pin all 30 dev deps via uv pip compile (PB-08)
- .github/workflows/ci.yml: add pip-audit step to security job (PB-08)
- .github/workflows/codeql.yml: new CodeQL SAST workflow for Python (PB-09)
- sbom.json: CycloneDX 1.6 SBOM, 372 components (PB-10)
- .github/workflows/publish.yml: regenerate SBOM on each release (PB-10)

Type coverage (PB-15):
- pyproject.toml: remove examples/ from mypy --strict exclusion list
- examples/react_tool_use.py: fix 5 mypy errors (split _SAFE_OPS into
  typed Callable dicts, annotate provider params as ToolCallingProvider);
  fix 3 ruff errors (UP035 Callable import, TC006 cast quote)

Note: PB-11 (OIDC trusted publishing) was already implemented in publish.yml.

Sprint 2 Definition of Done:
- 387 tests pass, 85% coverage
- mypy --strict clean across 26 source files (executionkit/ + examples/)
- ruff clean across all files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@tafreeman tafreeman merged commit 8075f67 into main May 12, 2026
9 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: e3335a72c4

ℹ️ 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 on lines +58 to +59
pip install cyclonedx-bom
cyclonedx-py environment --of JSON --output-file sbom.json
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 Generate the SBOM from the package, not the tool env

In the release workflow this runs cyclonedx-py environment immediately after installing only build and cyclonedx-bom, before executionkit or its locked dependencies are installed. I checked the CycloneDX CLI docs: the environment subcommand builds from the actually installed/current Python environment, so release SBOM artifacts will inventory the SBOM/build tooling environment rather than the distribution being published; the committed sbom.json shows the same failure mode by listing unrelated packages such as Authlib that are absent from pyproject.toml and requirements.lock. Generate from a clean project environment or the lock/requirements file with the project metadata instead.

Useful? React with 👍 / 👎.

@tafreeman tafreeman deleted the claude/elegant-leavitt-dc490e branch May 12, 2026 02:02
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request focuses on enhancing the project's documentation and architectural clarity by adding a portfolio orientation guide, a detailed backlog for future improvements, and several Architecture Decision Records (ADRs) regarding structural protocols and package layout. It also includes technical refinements such as adding a lockfile, restructuring historical planning documents, and enabling type checking for the examples directory. Review feedback suggests correcting a technical inaccuracy in the protocols ADR, improving type annotations in the examples to avoid brute-force casting, and further expanding type-checking coverage to include the test suite.

### Positive Consequences

* Any object with the right method signatures satisfies `LLMProvider` — including `MockProvider`, custom wrappers, and third-party clients.
* `@runtime_checkable` enables `isinstance(provider, LLMProvider)` checks inside `_TrackedProvider.supports_tools` without requiring inheritance.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This sentence contains a technical inaccuracy regarding the implementation. _TrackedProvider.supports_tools (in executionkit/patterns/base.py) is a hardcoded Literal[True] field; it does not perform an isinstance check. The ADR should accurately reflect that @runtime_checkable enables external components (like react_loop) to verify the provider's capabilities without requiring explicit inheritance.

Comment on lines +180 to 187
provider = cast(
"ToolCallingProvider",
Provider(
base_url="https://api.openai.com/v1",
api_key=os.environ["OPENAI_API_KEY"],
model="gpt-4o-mini",
),
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using cast with a string literal for a type that is already imported is suboptimal. For a "principal-grade" artifact, it is preferable to use a type annotation on the variable. This allows the type checker to verify the implementation structurally against the protocol without the brute-force override of a cast.

    provider: ToolCallingProvider = Provider(
        base_url="https://api.openai.com/v1",
        api_key=os.environ["OPENAI_API_KEY"],
        model="gpt-4o-mini",
    )

Comment thread pyproject.toml
python_version = "3.11"
strict = true
exclude = ["tests/", "examples/"]
exclude = ["tests/"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While removing examples/ from the mypy exclusion is a significant improvement, tests/ remains excluded. As noted in the project's own architecture review (Finding BP-H2), this allows type errors in test fixtures and shared helpers to go unnoticed. To achieve the stated goal of "principal-grade artifacts," the test suite should also be subject to type checking, potentially with a dedicated override section for more relaxed rules if necessary.

Suggested change
exclude = ["tests/"]
exclude = []

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.

3 participants