Skip to content

[Upstream PR #187] Add durable self-dev customization records #140

@quangdang46

Description

@quangdang46

Mirrored from upstream 1jehuang/jcodePull Request #187 by @ptlnextdoor
Original state: open
Created: 2026-05-11T02:32:03Z · Updated: 2026-05-11T05:59:00Z
Diff: https://github.com/1jehuang/jcode/pull/187.diff
This issue is an auto-mirrored copy. Comments and edits here are local to quangdang46/jcode — do not expect them to propagate upstream.


Summary

Adds durable self-dev customization records so Jcode can persist, inspect, and report user-local adaptations across update/install flows.

This PR implements the first self-dev customization slice from #32 and addresses issues #35, #36, and #37:

  • Defines a versioned SelfDevCustomizationRecord schema with stable IDs, timestamps, active/disabled state, base version metadata, provenance, rationale, validation commands, and update hints.
  • Persists customization records to stable on-disk storage with create/load/list/append-outcome support.
  • Adds selfdev tool actions for recording, listing, disabling, and inspecting active customizations.
  • Captures both tracked diffs and untracked files in saved customization patches so the source fingerprint and stored patch match more accurately.
  • Integrates active customization records into update/install reporting.
  • Runs configured validation commands during update/install reporting and records report-only pass/fail details, including status, exit code, and truncated stdout/stderr.
  • Cleans up compact active-customization memory when a customization is disabled while keeping durable records as the source of truth.

Fixes #35
Fixes #36
Fixes #37

Testing

Passed on the rebased branch:

cargo test -p jcode-selfdev-types -p jcode-build-support customization --lib
cargo test record_customization_creates_record_and_list_output --lib
cargo test disable_customization_removes_compact_memory_and_active_status --lib
cargo test update_validation_command_reports_success --lib
cargo test update_validation_command_reports_failure --lib
cargo check
cargo build

Notes:

  • cargo check and cargo build pass with existing warnings.
  • A broad cargo test selfdev --lib run hit two unrelated/flaky failures on macOS:
    • cli::tui_launch::tests::spawn_selfdev_in_new_terminal_uses_handterm_exec_mode due to /private/var vs /var temp path normalization.
    • tool::selfdev::tests::build_dedupes_identical_reason_and_version_with_attached_watcher due to a background task timeout.
  • The targeted customization/update validation coverage added by this PR passed after rebasing onto origin/master.

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions