PCF-DCP: full TypeScript / .NET / PHP ports + cross-port conformance#24
Open
kduma wants to merge 5 commits into
Open
PCF-DCP: full TypeScript / .NET / PHP ports + cross-port conformance#24kduma wants to merge 5 commits into
kduma wants to merge 5 commits into
Conversation
The v0.0.9 release-prepare bump missed three crates added in the same cycle, leaving path-dependency version pins at 0.0.8 while the crates themselves are 0.0.9. Because a `^0.0.8` requirement excludes 0.0.9, cargo could not resolve the workspace at all. - reference/PFS-MS-v1.0: bump pcf-sig and pcf-sig-cli pins to 0.0.9. - tools/pcf-sig: bump its own version and its pcf / pcf-sig pins to 0.0.9. - release-prepare.yml: add the missing sed lines (tools/pcf-sig version + pins, PFS-MS pcf-sig / pcf-sig-cli pins) so future bumps stay in lockstep. cargo build --workspace is green again. https://claude.ai/code/session_01XzcjWWbNiuNX9ZywevfbQu
Full library port of the PCF-DCP profile to TypeScript, modeled 1:1 on the
@kduma-oss/pcf-sig port and layered strictly above @kduma-oss/pcf (no crypto
dependencies — DCP does not sign; data/table hashing comes from the base pcf).
- src/{consts,errors,header,fragment}.ts: on-disk records (24 B DCP Header,
9 B Fragment Table header, 18 B Fragment Entry) + walk/reconstruct.
- src/arena.ts: in-memory model with content-defined dedup (intra/inter
partition), copy-on-write edits (append/insert/overwrite/delete/truncate),
mark-and-sweep compaction that normalises the SHARED flag, and a canonical
serialiser reproducing the spec Section 17 layout.
- src/reader.ts: DcpReader over Container (trailer-mode transparent); full
DCP-aware verify. src/writer.ts: DcpWriter whole-file model with promotion
(a MOVE preserving uid + data_hash), demotion, dedup, defrag, optional trailer.
- src/vector.ts + examples/gen-testvector.ts reproduce the byte-exact 700-byte
vector (SHA-256 b9bb5979…), identical to the Rust reference and the other
ports. testdata/canonical.bin shipped (gitignore negation added).
- 28 vitest tests (canonical, spec-compliance, roundtrip, coverage);
coverage >=85% lines / >=90% functions.
Wiring: add pcf-dcp to the ts workspace; build/test/test-vector(700)/coverage
in ts-ci.yml; npm publish -w @kduma-oss/pcf-dcp after pcf-sig in release.yml.
https://claude.ai/code/session_01XzcjWWbNiuNX9ZywevfbQu
Full library port of the PCF-DCP profile to C#/.NET (netstandard2.0), modeled
1:1 on the KDuma.Pcf.Sig port and layered strictly above KDuma.Pcf via a
ProjectReference. No crypto dependency — data/table hashing comes from the base
PCF library.
- src/Pcf.Dcp/{Constants,PcfDcpException,LittleEndian,DcpHeader,FragmentEntry,
FragTableHeader,Chunker,InnerInfo}.cs: on-disk records + Fragment Table walk/
reconstruct.
- src/Pcf.Dcp/Arena.cs: in-memory model with content-defined dedup (intra/inter
partition), copy-on-write edits (Append/Insert/Overwrite/Delete/Truncate),
mark-and-sweep compaction normalising the SHARED flag, and a canonical
serialiser reproducing the spec Section 17 layout.
- src/Pcf.Dcp/DcpReader.cs: DcpReader over Container (trailer-mode transparent)
with full DCP-aware Verify. src/Pcf.Dcp/DcpWriter.cs: whole-file model with
Promote (a MOVE preserving uid + data_hash), Demote, Dedup, Defrag, trailer.
- src/Pcf.Dcp/ReferenceVector.cs reproduces the byte-exact 700-byte vector
(SHA-256 b9bb5979…), identical to the Rust reference and the TS port.
testdata/canonical.bin shipped.
- 28 xUnit tests (canonical, spec-compliance, roundtrip, coverage), all green;
dotnet pack produces KDuma.Pcf.Dcp.nupkg.
Wiring: dotnet-ci.yml paths + matrix include pcf-dcp; release.yml adds a
publish-nuget-dcp job (needs publish-nuget). Shared Directory.Build.props
already carries the 0.0.9 version.
https://claude.ai/code/session_01XzcjWWbNiuNX9ZywevfbQu
Full library port of the PCF-DCP profile to PHP (>=8.1), modeled 1:1 on the
kduma/pcf-sig port and layered strictly above kduma/pcf via a path repository.
No crypto dependency (ext-sodium not required) — data/table hashing comes from
the base PCF library (ext-hash).
- src/{Consts,ErrorKind,PcfDcpException,DcpHeader,FragmentEntry,FragTableHeader,
FragmentTable,Chunker,ExtentInfo,InnerInfo}.php: on-disk records + Fragment
Table walk/reconstruct.
- src/Arena.php: in-memory model with content-defined dedup (intra/inter
partition), copy-on-write edits (append/insert/overwrite/delete/truncate),
mark-and-sweep compaction normalising the SHARED flag, and a canonical
serialiser reproducing the spec Section 17 layout.
- src/DcpReader.php: DcpReader over Container (trailer-mode transparent) with
full DCP-aware verify. src/DcpWriter.php: whole-file model with promote (a
MOVE preserving uid + data_hash), demote, dedup, defrag, trailer.
- src/ReferenceVector.php reproduces the byte-exact 700-byte vector
(SHA-256 b9bb5979…), identical to the Rust reference and the TS/.NET ports.
testdata/canonical.bin shipped.
- 28 PHPUnit tests (canonical, spec-compliance, roundtrip, coverage), all green;
composer validate --strict passes.
Wiring: php.yml test + test-vector(700) matrices include pcf-dcp; php-split.yml
splits to PHP-PCF-DCP-lib; release-prepare.yml bumps the pcf-dcp composer pin.
https://claude.ai/code/session_01XzcjWWbNiuNX9ZywevfbQu
Mirror the PCF-SIG cross-port machinery for DCP so all four implementations are held to the same byte-exact canonical vector. - reference/PCF-DCP-v1.0/tests/cross_port_testdata.rs: assert that the testdata/canonical.bin shipped by each language port (TS, PHP, .NET) is byte-identical to the reference 700-byte vector, and that the reference is exactly 700 bytes. - cross-port-interop.yml: add a cross-port-byte-exact-dcp job that regenerates the DCP vector from each writer (Rust example, TS/PHP gen-testvector, an on-the-fly .NET CLI over ReferenceVector.Build) and asserts all four match the pinned SHA-256 b9bb5979… and each other; add DCP trigger paths. Verified locally: the Rust, TypeScript, PHP and .NET writers all emit the same 700-byte file with SHA-256 b9bb59794abed008863063886d8d0daa810c44939c1c5d29449475ced8156b90. https://claude.ai/code/session_01XzcjWWbNiuNX9ZywevfbQu
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Brings the PCF-DCP profile (Dynamic Container Partition) from Rust-only to
full parity across all four languages, modeled 1:1 on the
pcf-sigports.Each port is a complete library — reader, writer, arena (content-defined dedup,
copy-on-write edits, sharing-preserving compaction), and promotion/demotion —
layered strictly above the base
pcfpackage with no cryptographicdependency (data/table hashing comes from
pcf). No CLI, matching thelibrary-only precedent of the existing profile ports.
The strongest guarantee: all four writers (Rust, TypeScript, .NET, PHP) emit
the byte-identical canonical 700-byte vector, SHA-256
b9bb59794abed008863063886d8d0daa810c44939c1c5d29449475ced8156b90(spec §17),verified locally and in CI.
Commits
5f169c5pfs-ms→pcf-sig/pcf-sig-cli, and all oftools/pcf-sig), leaving them at0.0.8while the crates are0.0.9. A^0.0.8requirement excludes0.0.9, socargocould not resolve the workspace at all. Bumps the pins and hardensrelease-prepare.ymlso it can't recur.5f64e80@kduma-oss/pcf-dcp— 28 vitest tests, coverage, byte-exact vector.d1105f9KDuma.Pcf.Dcp(netstandard2.0) — 28 xUnit tests,dotnet pack, byte-exact vector.d605cb2kduma/pcf-dcp(≥8.1) — 28 PHPUnit tests,composer validate, byte-exact vector.c290104cross_port_testdatatest asserting each port ships the identical 700-bytecanonical.bin, plus across-port-interop.ymljob that regenerates all four writers and pins the SHA.Each port mirrors the Rust crate
consts/errors/header/fragment— on-disk records (24 B DCP Header, 9 B Fragment Table header, 18 B Fragment Entry) + walk/reconstruct.arena— in-memory byte pool + fragment lists; content-defined dedup (intra- and inter-partition), CoW edits (append / insert / overwrite / delete / truncate via fragment splitting), mark-and-sweepcompactnormalising theSHAREDflag, and a canonical serialiser reproducing the §17 layout.reader—DcpReaderover the baseContainer, so trailer-mode host files read transparently; full DCP-awareverify(innertable_hash, reconstruction length +data_hash, no nesting, file-wide uid uniqueness).writer— whole-file model with promotion (a MOVE preserving uid +data_hash— the promotion invariant), demotion, dedup, defrag, optional trailer.vector+ example +testdata/canonical.bin.CI / release wiring
ts-ci.yml(build / test / 700-byte test-vector / coverage) +release.ymlnpm publish.dotnet-ci.ymlmatrix +release.ymlpublish-nuget-dcpjob.php.ymlmatrix + 700-byte test-vector +php-split.yml(→PHP-PCF-DCP-lib) +release-prepare.ymlcomposer pin bump.cross-port-interop.ymlcross-port-byte-exact-dcpjob.Verification (local)
cargo build/test/clippy/fmtgreen (incl. the newcross_port_testdata).npm test -w @kduma-oss/pcf-dcp(28) + coverage thresholds.dotnet test(28) +dotnet pack.vendor/bin/phpunit(28) +composer validate --strict.https://claude.ai/code/session_01XzcjWWbNiuNX9ZywevfbQu
Generated by Claude Code