Skip to content

feat(deploy,auth): warn when the V2 assertion spec is unsupported - #118

Merged
makemake-kbo merged 5 commits into
mainfrom
feat/warn-unsupported-v2-spec
Jul 28, 2026
Merged

feat(deploy,auth): warn when the V2 assertion spec is unsupported#118
makemake-kbo merged 5 commits into
mainfrom
feat/warn-unsupported-v2-spec

Conversation

@makemake-kbo

Copy link
Copy Markdown
Contributor

Why

app.phylax.systems (Linea) runs the V1 assertion spec. Assertions written against the V2 triggers and precompiles either get rejected at release time or deploy and never fire — and pcl said nothing about it either way.

What

pcl deploy scans the assertion sources listed in credible.toml for V2-only identifiers (V2 triggers, fork helpers, fork-aware reads, protection-suite precompiles, cumulative-flow circuit breakers, PhEvm.ForkId/TriggerContext) and warns when the target is that platform or a Linea chain (59144 / 59141):

Warning: https://app.phylax.systems (Linea Mainnet, chain 59144) runs the V1 assertion spec, but these assertions use V2:
  assertions/src/VaultAssertion.a.sol — registerTxEndTrigger, staticcallAt
V2 triggers and precompiles do not run there: the release can be rejected, or the assertion can deploy and never trigger. Rewrite these assertions against the V1 spec, or deploy to a platform that runs V2.

It prints before the protocol-manager step — nothing mutated yet, so Ctrl-C is still free — and again with the result, since a long deploy scrolls the first one away. Machine output carries it in data.warnings (also on --dry-run) with code: assertion_spec.v2_unsupported plus the per-file marker list. It never blocks a deploy: the platform decides what it accepts, and a stale marker list must not be the reason a release stops.

pcl auth login warns when the login target is that platform, so the constraint is known before any assertion gets written. Human mode prints it after the login result; machine mode attaches a warnings array to the login envelope (short-circuit, --no-wait challenge, JSONL terminal event, and auth poll).

Detection

Only the project's own assertion sources are read, never the flattened output: a V2-capable credible-std declares every V2 identifier whether or not an assertion calls it, so flattened source would warn on every project. Comments are stripped, matches need an identifier boundary and a call/type shape, and unreadable files are skipped — a warning check must never fail a deploy.

Heuristic, so it can miss V2 usage that lives in a project-local helper file rather than the declared assertion file. Both directions are recoverable because the outcome is only a warning.

Not included

pcl apply also creates releases and shares the payload builder, but the ask was deploy + login; say the word and it's a three-line addition there.

Testing

  • 14 new unit tests: marker detection (V1 sources stay silent, commented-out and look-alike identifiers ignored, unterminated block comments, non-ASCII sources), source scanning, warning decisions per platform/chain, envelope shapes, and the deploy/auth wiring.
  • make ci equivalents green: cargo fmt --check, clippy pedantic, cargo check --features full (dev + release), full test suite, cargo doc, agent-smoke.
  • Manual: pcl deploy --dry-run (human + --json) against a V2-marker fixture on production vs. a V2-capable platform vs. a V1 fixture, and pcl auth login (human + --json) against production vs. a custom platform.

🤖 Generated with Claude Code

app.phylax.systems (Linea) runs the V1 assertion spec, so assertions
written against the V2 triggers and precompiles either get rejected or
deploy and never fire. Both cases were silent until now.

`pcl deploy` scans the assertion sources listed in credible.toml for
V2-only identifiers and warns when the target is that platform or a Linea
chain, naming the files and markers. It prints before the protocol-manager
step (nothing mutated yet) and again with the result, and machine output
carries it in `data.warnings`. It never blocks a deploy: the platform
decides what it accepts, and a stale marker list must not stop a release.

`pcl auth login` warns up front when the login target is that platform, so
the constraint is known before any assertion is written.

Detection deliberately reads only the project's own sources, not the
flattened output: a V2-capable credible-std declares those identifiers
whether or not an assertion uses them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread crates/pcl/core/src/assertion_spec.rs Outdated
Comment thread crates/pcl/core/src/assertion_spec.rs Outdated
mateo-mro
mateo-mro previously approved these changes Jul 27, 2026
@makemake-kbo
makemake-kbo enabled auto-merge (squash) July 27, 2026 09:53
The marker list stopped short of several APIs credible-std places under
its V2 section headers -- watchAnomaly, ph.anomalyContext, ph.store,
ph.changedMappingKeys, the math precompiles, the mapping-tracing and
flow-rate reads, and the V2-only structs. An assertion using only one of
them deployed to a V1 platform unwarned, which is the exact miss the
check exists to catch. The lists now mirror the full surface, and
`v2_surface_is_covered` pins them to a table of representative call
sites so a new V2 API cannot land in only one of the two places.
`ph.load` stays out on purpose: the V1 and V2 overloads share a name.

Scanning tracked a path only once it produced a finding, so one shared
V1 source referenced by twenty contracts was read twenty times. Path
deduplication moves into `unique_assertion_paths`, ahead of the read, so
startup scales with unique files rather than references.
Comment thread crates/pcl/core/src/deploy.rs Outdated
Comment thread crates/pcl/core/src/assertion_spec.rs
Two review points:

- The pre-deploy warning was printed after step 1, so for a new project it
  landed only once the create POST had succeeded and credible.toml had been
  rewritten. It now prints before step 1 using the platform and the requested
  chain; the post-resolve pass still runs for an existing project (whose chain
  is only known after the fetch) but no longer reprints.
- The source scanner had no string state: a literal holding `/*` blanked the
  rest of the file and a literal holding a V2 call read as usage. Literals are
  now blanked with their quotes preserved, escapes included.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread crates/pcl/core/src/assertion_spec.rs Outdated
Comment thread crates/pcl/core/src/deploy.rs
Comment thread crates/pcl/core/src/assertion_spec.rs Outdated
Comment thread crates/pcl/core/src/deploy.rs Outdated
Comment thread AGENTS.md Outdated
@makemake-kbo
makemake-kbo merged commit c22af9f into main Jul 28, 2026
13 checks passed
@lean-apple
lean-apple deleted the feat/warn-unsupported-v2-spec branch July 29, 2026 10:38
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