Skip to content

feat(files): add editable artifact versions - #1204

Draft
roxi3906 wants to merge 5 commits into
aipoch:mainfrom
roxi3906:feat/user/text-artifact-versioning
Draft

feat(files): add editable artifact versions#1204
roxi3906 wants to merge 5 commits into
aipoch:mainfrom
roxi3906:feat/user/text-artifact-versioning

Conversation

@roxi3906

Copy link
Copy Markdown
Contributor

Summary

Adds immutable editing and version comparison for allowlisted UTF-8 text Artifacts and Uploads. Markdown, plain text, scripts, and source-code files can be edited as raw text; each save publishes a new managed version while preserving source lineage.

Related TAPD parent: 1137438753001002003.

Highlights

  • Adds header Edit and Compare actions, raw-source editing, version navigation, and predecessor diff highlighting for editable text files.
  • Stores each edit as an immutable version named v<8 lowercase alphanumeric>_<original name> and records current head, base version, original file metadata, storage identity, checksum, and provenance in SQLite.
  • Resolves current DB heads for preview, download, project/session export, mentions, Agent inputs, and references while preserving explicit historical-version reads.
  • Supports generated Artifacts and uploaded files, including generated same-run predecessor chains, legacy recovery, and the no-native Windows export fallback with size/checksum verification.

Impact

  • Adds immutable application migration 0004_managed_file_version_foundation; released migrations 0001-0003 remain unchanged.
  • Expands the native managed-file module with anchored read/write/verify primitives and adds diff@9.0.0.
  • Touches Main, preload, shared contracts, renderer preview state, project catalog/reference resolution, and Electron E2E.
  • Keeps non-text preview behavior unchanged and gates editing through the centralized UTF-8 allowlist/capability result.

Test Results

All checks ran after the final material edit and integration rebase.

  • Full portable suite: npx vitest run --maxWorkers=4 - 1,021 files and 15,195 tests passed; 14 files / 208 tests skipped.
  • Build and type safety: npm run build - Node/Web typecheck and Electron/Web production builds passed.
  • Lint: npm run lint -- --no-cache - 0 errors; 10 existing warnings outside this change.
  • Real Electron workspace journey: npx playwright test e2e/workspace-files.spec.ts - 2/2 passed, covering Markdown edit/version/diff navigation and existing image preview.
  • Database schema/ledger: npm run db:schema:check and focused migration/ledger suites passed.
  • Independent module reviews, rebase-integration reviews, and final standards/spec reviews: Ready: Yes.

Potential Issues

  • Local real-Electron validation ran on macOS; cross-platform native builds and the Windows fallback remain authoritative in PR CI.
  • The Windows fallback is covered by unit/integration tests, but a real Windows UI journey was not run locally.
  • The feature crosses multiple existing file consumers; review should focus on migration/current-head semantics, atomic publication, exact historical reads, and preview edit/diff state.

Authors

@github-actions github-actions Bot added the enhancement New feature or request label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant