Repository navigation
feat(FOSS-454): public API guide and offline packaged Cargo consumer #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5dafec0
feat(FOSS-454): example exercises atomic API and hostile pin from inv…
jmsbooth abe2762
test(FOSS-454): verify actual unpublished crate archive in isolated o…
jmsbooth 5d128cc
test(FOSS-454): freeze clean-room consumer output and hostile archive…
jmsbooth bea4adf
test(FOSS-454): freeze clean-room consumer output and hostile archive…
jmsbooth bbf9e6d
docs(FOSS-454): correct public API behavior and package metadata
jmsbooth 4a8d246
docs(FOSS-454): correct public API behavior and package metadata
jmsbooth 1b35531
docs(FOSS-454): correct public API behavior and package metadata
jmsbooth 4a59de2
docs(FOSS-454): complete public API, trust model and packaged clean-r…
jmsbooth 34ba6c1
test(FOSS-454): tighten package checker imports, regex and toolchain …
jmsbooth 618f005
ci(FOSS-454): gate actual packaged offline consumer on stable and MSRV
jmsbooth b7e072f
chore(FOSS-454): integrate E2 F1 F2 baseline with packaged clean-room…
jmsbooth 7c951fc
docs(FOSS-454): align public developer adoption and five required gates
jmsbooth d85052f
docs(FOSS-454): align public developer adoption and five required gates
jmsbooth 40bc3a5
docs(FOSS-454): correct all five required-check instructions after re…
jmsbooth 6b4b53b
fix(FOSS-454): pin Cargo target dir and reject stale packaged archives
jmsbooth 4d6b077
test(FOSS-454): expose and enforce controlled package target location
jmsbooth f9e51e3
test(FOSS-454): regression for injected Cargo target directory
jmsbooth ef2a010
fix(FOSS-454): import Path and tempfile for isolated Cargo target reg…
jmsbooth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Cryptoshift v1: Developer Guide | ||
|
|
||
| Cryptoshift is an offline, evidence-bound Rust library for **advisory** cryptographic migration planning. Its planned post-quantum transition stages are deterministic and source-pinned. It does not scan your environment, encrypt data, authenticate vendors or operators, modify workloads, publish packages, or grant permission to migrate. | ||
|
|
||
| ## Build and Inspect | ||
|
|
||
| The package is currently unpublished and the Cargo manifest deliberately contains `publish = false`. From a clean Git checkout with Rust 1.85 or newer: | ||
|
|
||
| ```sh | ||
| cargo fmt --all -- --check | ||
| cargo check --workspace --all-targets --all-features --locked | ||
| cargo clippy --workspace --all-targets --all-features --locked -- -D warnings | ||
| cargo test --workspace --all-features --locked | ||
| RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps --locked | ||
| cargo run -p cryptoshift --example migration_plan --locked | ||
| ``` | ||
|
|
||
| The example constructs one synthetic inventory snapshot, a directed evidence graph, and a scoped target, then computes SCC topology, cryptographic risk, remediation blockers, nonauthorizing waves, and an immutable plan. It runs the same fixture through `AnalysisRunner::analyze` and requires the atomic plan digest to equal the manually composed plan digest. It also checks a forged graph source pin is rejected **without a partial plan**. | ||
|
|
||
| Expected behavioral lines include: | ||
|
|
||
| ```text | ||
| migration plan state: Partial | ||
| readiness: Unverified | ||
| atomic analysis state: Partial | ||
| forged graph pin: Failed | ||
| This is not an authorization to execute, migrate, or approve changes. | ||
| ``` | ||
|
|
||
| Do not interpret `Partial` as a failed test: it correctly records missing owner/capability evidence and authority. `Complete`, `Warnings`, and the associated external-review classification remain reserved in v1 because this library cannot independently authenticate those facts. Those states must not be synthesized from unverified claims. | ||
|
|
||
| ## Public API Boundaries | ||
|
|
||
| | Stage | Entry point | Contract | | ||
| |---|---|---| | ||
| | Source admission | `ValidatedInventorySnapshot`, `NeutralInventoryAdapter` | Scoped, bounded, versioned source facts; not collector authentication | | ||
| | Graph | `EvidenceGraph` | Typed, evidence-bound edges, canonical fingerprint | | ||
| | Dependencies | `DependencyAnalysis::analyze` | Iterative SCCs and prerequisite-first order | | ||
| | Risk | `RiskAnalysis::analyze` | Evidence-qualified factor vector, not an authorization score | | ||
| | Desired state | `TargetProfile`, `CapabilityCatalog` | Explicit algorithm/protocol constraints and untrusted vendor source attributes | | ||
| | Peer assessment | `CompatibilityAnalyzer::analyze` | Hostile negotiation, PKI and downgrade checks, never authoritative interoperability | | ||
| | Remediation | `RemediationAnalyzer` | Blocker and prerequisite-linked review actions; no execution | | ||
| | Waves | `WavePlanner` | Bounded, prerequisite-preserving advisory waves | | ||
| | Plan | `MigrationPlanner` | Digest-bound immutable plan, residual risk and claimed exception records | | ||
| | Atomic facade | `AnalysisRunner::analyze` | One complete advisory draft or one typed failure with no partial artifact | | ||
|
|
||
| All public schema/version constants are exported from `cryptoshift::`. Use the version constants and explicit `Limits` rather than guessing wire formats. Source-content SHA-256 fingerprints detect changes but are **not signatures** or identity attestations. A caller must obtain expected digests from an independently trusted channel. All sample timestamps are explicit synthetic UTC Unix seconds. An expired profile or cross-tenant/stale source must not be silently accepted. | ||
|
|
||
| The neutral handoff adapters currently use Cryptoshift-owned fixture structures; real Cryptomap and Cryptopolicy native interoperability is outside this release's verified acceptance. FOSS-513 tracks a separate trusted-evidence capability for any eventual actionable Complete/Warnings outcome. | ||
|
|
||
| ## Clean-Room Package Adoption | ||
|
|
||
| A repo-relative Rust path dependency does not verify that a downstream developer can use the actual crates.io-shaped archive. FOSS-454 includes `scripts/package_consumer_check.py` to exercise the archive itself. | ||
|
|
||
| ```sh | ||
| python3 -m unittest scripts.test_package_consumer_check -v | ||
| python3 scripts/package_consumer_check.py | ||
| python3 scripts/package_consumer_check.py --toolchain 1.85.0 | ||
| ``` | ||
|
|
||
| The script performs `cargo package --offline --locked` without publishing, checks package identity and declared MSRV, validates bounded extraction paths and archive types, creates an **isolated temporary Cargo project outside this repository**, and compiles the existing inventory-to-plan example against the unpacked crate. It generates a detached consumer lockfile offline, executes with `--frozen` twice, checks exact output determinism, and compares the key behavior against `tests/acceptance/packaged-consumer.golden`. The acceptance script prints the SHA-256 of the package archive and consumer output as traceability data. The temporary project is removed when validation finishes. | ||
|
|
||
| The consumer depends on the *unpacked archive*, not the workspace, and uses no crates.io registry publishing token. Cargo's offline flag makes missing cached dependencies a reproducible setup error rather than an implicit network operation. The package remains marked `publish = false` throughout this acceptance process. | ||
|
|
||
| ## Verification Limits | ||
|
|
||
| The suite covers Linux stable, Linux Rust 1.85, Windows stable and Windows Rust 1.85 via CI. The Windows acceptance also replays versioned E2 source/enterprise conformance and checks the detached neutral consumer. FOSS-453 provides performance smoke and frozen semantic identities, not execution authorization or timing-based CI thresholds. | ||
|
|
||
| Before any public crate release, the owner must separately approve the release version, package ownership, branch protections, verified reproducible artifacts, dependency/security report, SBOM and provenance, and an explicit restricted publishing operation (FOSS-456). Nothing in this guide authorizes publication. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.