feat(adt-flow): add incremental transport checkout
Merged
TH
1mo ago+5589+5589+0123456789012345678901234567890123456789-421-421-012345678901234567890123456789
Summary
Adds the Git-independent @abapify/adt-flow core and delivery surfaces for exact transport base/head trees. Existing SAP objects appear as modifications, moves, or deletions instead of pseudo-creations.
This PR includes the stacked foundation slice (format tree materialization) plus the transport checkout core and CLI/MCP delivery surfaces.
Scope
- introduces public
@abapify/adt-flow - adds typed root
flowconfiguration andadt flow checkout tr <TR[,TR...]> [--base] - binds the shared service to authenticated ADT manifest, immutable source, object, and package metadata operations
- materializes base-before-earliest-scope or head-newest-in-scope selections
- stores deterministic
.adt/trand.adt/objectsdescriptors with hashes and version identities - reconciles create, update, package move, delete, and no-op without invoking Git
- exposes confined
flow_checkout_trMCP parity over the same service - adopts format-recognizable files when descriptors do not exist
- rejects inexact manifests, divergence, traversal, duplicate ownership, unowned collisions, and portable case collisions before writes
- explicitly defers historical commit replication and metadata reconstruction
Incremental evidence
- exact repeated head: zero SAP calls and zero writes
- indexed base: one metadata-only manifest, zero object/package/source calls
- deleted
.adt: same source tree with expected extra source read - first-observed deletion: existing format files are removed without a prior descriptor
- package reassignment: old-path removals plus new-path writes, reported only as moves
- local Git fixture: one modification, one 100% rename pair, one deletion pair, and a transport descriptor
Verification
- adt-flow behavioral/contracts: 18 passed
- focused MCP delivery tests: 2 passed
- affected Nx test/build/lint matrix: passed
- frozen Bun install: passed
- strict OpenSpec validation and diff checks: passed
- full MCP suite baseline audit: the same three unrelated failures reproduce on committed HEAD before this slice
- public-content and commit-metadata audit: passed
Test plan
-
pnpm nx run-many -t test,build,lint --projects=adt-flow,adt-mcp,adt-plugin,adt-plugin-abapgit,adt-config -
adt flow checkout tr <TR>against a sandbox transport (head and--base) - MCP
flow_checkout_trreturns the same structured result as the CLI - Re-run checkout with warm
.adtdescriptors confirms zero SAP calls / zero writes
Made with Cursor
Summary by cubic
Adds incremental transport checkout to materialize exact base/head source trees from immutable SAP source versions. Hardens repository safety and format materialization, enforces descriptor and ownership invariants, and exposes CLI/MCP flows for review-ready changes without Git.
-
New Features
- CLI/MCP: validate
flowconfig (flowConfigSchemain CLI; MCP loadsflowfrom server/workspace config via@abapify/adt-config), re-resolveworkspaceRoot, and return structured error codes.
- CLI/MCP: validate
-
Bug Fixes
- Validation/Determinism: enforce descriptor identity and tombstone invariants; validate transport IDs and ownership; validate owned file paths with
safeRelativePath; preservetoJSONsemantics instableJson/digests (now passes the JSON key); fix base/head fast path and owned-file unions; fail fast if base/head boundary versions are missing. - Repository/Workspace/MCP: resolve chained symlinks; validate physical roots before reads/walks/writes/removals; harden path-collision and traversal checks; skip symlinks in walks; exclusive temp-file writes and symlink-aware snapshots; revalidate
workspaceRootat execution time and reject symlink roots; track created directories and clean up on rollback;flow_checkout_trpreserves error codes/messages and reportsconfiguration_invalid/format_unsupported. - Repository/abapGit: honor explicit historical sources (including empty maps) with an explicit source guard and
supportsExplicitSources; propagate source-read errors forBDEF/SRVDand reject unsupported source components inSRVD; accept explicit sources forTABL/TABL-DSand decode XML entities; normalizeFUGRtop-include mapping and exclude only exactLTOP/SAPLkeys; restrict filename parser to abapGit extensions and classify non-XML files as source; discover.abdl/.asrvdsources; preservepackage.jsonexport conditions and disable tsdown overwrites. - Code health: reduce complexity in
@abapify/adt-flowservice and helpers; extract TABL serializer helpers; cleanup README/tests/tsconfig; no behavior changes.
- Validation/Determinism: enforce descriptor identity and tombstone invariants; validate transport IDs and ownership; validate owned file paths with
Summary by CodeRabbit
- New Features
- Added transport checkout for materializing ADT source trees at base or head boundaries.
- Added equivalent CLI and MCP access with structured results and workspace confinement.
- Added configurable format selection, filtering, concurrency, and source-size limits.
- Added deterministic abapGit materialization, descriptors, caching, and rollback-capable reconciliation.
- Bug Fixes
- Added safeguards for unsafe paths, collisions, local divergence, ambiguous history, and unsupported formats.
- Documentation
- Added usage, configuration, and materialization guidance.
- Tests
- Added comprehensive checkout, validation, confinement, and reconciliation coverage.