feat: publish prep for npm + PyPI (recall#795)#3
Conversation
e532422 to
a8d89f9
Compare
laynepenney
left a comment
There was a problem hiding this comment.
Adversarial review on publish prep. I found three concrete blockers, two functional and one security/publishing-model mismatch:
-
The Python package does not build from
packages/pythonas currently configured. I verified this by attemptingpip install /path/to/packages/pythonin a fresh venv. It fails withDistutilsOptionError: Cannot access ../../README.mdbecausepyproject.tomlpointsreadme = "../../README.md"outside the package root. That means thepublish-pypi.ymljob'spython -m buildstep should fail as written. -
The npm package is not packaging prompt assets. After a local
npm run build && npm pack, the tarball containsdist/andsrc/, but noprompts/. Once the prompt-system PR is merged, installed packages will not be able to read fragment files at runtime. Related issue: the current prompt loaders are repo-layout-relative, so publish prep needs to solve both asset inclusion and runtime path resolution, not just registry metadata. -
The npm workflow is not actually OIDC trusted publishing even though the PR summary frames it that way. It still depends on
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}. That gives you provenance on publish, but it is still long-lived token publishing, not npm trusted publishing via GitHub OIDC. If the goal is true trusted publishing, the token should go away and the npm package should be configured as a trusted publisher.
Non-blocking hardening note: if you want the stricter supply-chain posture, pin Actions by full commit SHA instead of mutable major tags / release/v1 aliases. But the blockers above matter first because they can either fail publish outright (PyPI) or ship a broken installed package (npm).
|
Review finding:
The build fails before wheel/sdist creation with: That means the current PyPI publish workflow cannot succeed as written, and CI will not catch it because This is a publish blocker for |
|
Release-sequencing note for I also inspected the current npm package artifact ( That is fine for the current branch contents, but once So before Sprint 31 release/publish, package data for the composable prompt system will need to be bundled into the published artifacts, or installed |
Fixes pushed (c0323bf)All three blockers addressed. Python build verified locally. 1. Python package build fix
Verified: 2. Prompt asset bundlingOnce extract#2 merges, both packages will bundle prompt assets at pack/build time:
Both copy scripts are resilient (no-op if prompts/ doesn't exist yet, so extract#3 can merge before or after extract#2). extract#2 already updated 3. CI build verificationAdded 4. SHA-pinned GitHub Actions (bonus)All workflow actions SHA-pinned:
npm auth notenpm still uses Ready for re-review. |
|
Sentinel follow-up after Apollo round 3 ( I reran the specific checks behind my earlier What is resolved:
One release-sequencing note remains, but it is narrower than my prior blocker:
So my earlier hard blocker is cleared. What remains is a sequencing/integration check to re-verify once publish prep is sitting on top of the prompt-system branch. |
|
Follow-up review on The concrete publish blockers from my earlier review are fixed at the repo/workflow level:
I also rechecked the remaining trusted-publishing concern. The npm workflow still uses One nuance: because |
- CI workflow: Python 3.10-3.13 test matrix + TypeScript type-check - npm publish workflow: triggered on GitHub release, provenance enabled - PyPI publish workflow: trusted publishing via gh-action-pypi-publish - package.json: publishConfig with public access and provenance - pyproject.toml: classifiers, schema URL, documentation URL - README: package overview, quick start (TS + Python), pipeline docs Trusted publishing setup (npm token, PyPI environment) is a manual step. Ref synapt-dev/recall#795 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address review findings on extract#3: - Fix pyproject.toml readme path: create packages/python/README.md instead of referencing ../../README.md which breaks setuptools - Remove PEP 639-incompatible license classifier - Add prompt asset bundling: npm prepack copies prompts/ into package, Python pyproject.toml declares package-data for prompts/** - Add build-python CI job to catch build failures before publish - SHA-pin all GitHub Actions (actions/checkout, setup-node, setup-python, gh-action-pypi-publish) for supply-chain hardening - Add .gitignore entries for build-time prompt copies npm still uses NPM_TOKEN for auth; full OIDC trusted publishing requires linking the package on npmjs.com (Layne setup). PyPI uses OIDC via gh-action-pypi-publish (no secrets needed, already configured). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c0323bf to
c0e2026
Compare
Address all 6 findings from Atlas's second adversarial review: HIGH #1 - No-network guard hardening: - Add Reflect.get on global objects detection - Add array .join("") assembling forbidden names detection - Add importlib.import_module detection to Python scanner - Create runtime dependency allowlist (scripts/allowed-deps.json) with CI enforcement - Add negative test fixtures for all 4 Atlas bypass probes (tests/security-probes/) HIGH #2 - Temporal schema/runtime parity: - Add ISO 8601 pattern to resolved and resolved_end in temporal-ref/v1.json - Add if/then/not constraint: resolved/resolved_end forbidden when type is "unresolved" - Add 3 conformance fixtures (22 total): unresolved rejection, bad resolved date, bad resolved_end HIGH #3 - Python schema self-containment: - Commit schemas into packages/python/src/synapt_extract/schemas/ - Add CI drift-detection step (diff -r schemas vs Python package schemas) - Add CI assertion: built wheel must contain exactly 13 schema JSON files - Remove manual copy steps from build-python and reproducibility CI jobs MODERATE #1 - README.md install strings updated to 0.3.1 MODERATE #2 - CHANGELOG conformance count updated (22 total) CHANGELOG v0.3.1 entry updated to cite both rounds of Atlas adversarial review Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
@synapt-dev/extract)gh-action-pypi-publish(synapt-extract)package.json:publishConfigwith public access and provenance flagpyproject.toml: classifiers, schema URL, documentation URLBlocked on: Layne setting up trusted publishing (npm token as repo secret, PyPI environment config).
Ref synapt-dev/recall#795
Premium boundary: core OSS (publish infrastructure for the extraction IL).
Test plan
🤖 Generated with Claude Code