Skip to content

Cleanup for Patchwork#18

Merged
expede merged 15 commits intomainfrom
cleanup2
Mar 11, 2026
Merged

Cleanup for Patchwork#18
expede merged 15 commits intomainfrom
cleanup2

Conversation

@expede
Copy link
Copy Markdown
Member

@expede expede commented Mar 11, 2026

No description provided.

This was referenced Mar 11, 2026
@expede expede marked this pull request as ready for review March 11, 2026 05:46
@expede expede requested a review from Copilot March 11, 2026 05:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates darn/darn_core to better interoperate with Patchwork/automerge-repo conventions by introducing an “immutable text” storage mode (LWW string), switching root directory IDs to automerge: URL serialization, and expanding CLI capabilities (verbosity controls + direct document editing).

Changes:

  • Add FileType::Immutable / Content::ImmutableString and propagate it through ingest/refresh/serialization.
  • Update .darn config format (automerge URL root id, force_immutable, attributes.immutable) and wire new ingestion flags through core + CLI.
  • Add darn doc edit (generic Automerge list edits) and add CLI verbosity levels (--quiet, --silent).

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
darn_core/tests/integration.rs Updates integration tests for new ingest signature and adds new coverage around directories, immutable classification, and sedimentree operations.
darn_core/src/workspace/registry.rs Updates WorkspaceId import path after workspace module API changes.
darn_core/src/workspace/layout.rs Updates WorkspaceId import path after workspace module API changes.
darn_core/src/workspace.rs Removes re-exports from workspace module (API cleanup).
darn_core/src/watcher.rs Updates tests to use TestResult and new DarnConfig::with_fields signature.
darn_core/src/unix_timestamp.rs Adds CBOR roundtrip property test.
darn_core/src/sync_progress.rs Adds tests for sync summary accumulation and apply result helpers.
darn_core/src/staged_update.rs Test cleanup: reduce expect usage and clippy allows.
darn_core/src/serde_base58.rs Adds automerge_url serde module + tests; expands docs.
darn_core/src/refresh.rs Adds refresh support for ImmutableString and coercion regression tests.
darn_core/src/manifest/tracked.rs Stops re-exporting Sedimentree from tracked module.
darn_core/src/manifest/content_hash.rs Adds known-answer and property tests for hashing.
darn_core/src/manifest.rs Updates tests to import Sedimentree directly from sedimentree_core.
darn_core/src/lib.rs Exposes new doc_edit module.
darn_core/src/ignore.rs Updates tests for new config schema and more Result-based assertions.
darn_core/src/file/name.rs Updates tests to use TestResult and avoid unwrap.
darn_core/src/file/metadata/permissions.rs Removes a couple of unit tests (keeps bolero/property tests).
darn_core/src/file/file_type.rs Introduces Immutable variant + serde/minicbor/display logic + tests.
darn_core/src/file/content.rs Adds ImmutableString variant and coerce_to helper + tests.
darn_core/src/file.rs Adds File::immutable, implements immutable string Automerge encoding/decoding, and improves attribute matching for workspace-relative globs.
darn_core/src/dotfile.rs Extends .darn schema (automerge URL root id, force_immutable, attributes.immutable) and updates defaults + tests.
darn_core/src/doc_edit.rs New generic Automerge document edit helpers (append/clear list by path) + tests.
darn_core/src/discover.rs Threads force_immutable through ingestion and improves attribute matching by passing workspace-relative paths.
darn_core/src/darn/refresh_diff.rs Adds tests for RefreshDiff helper semantics.
darn_core/src/darn.rs Removes workspace registry side-effects, adds refresh coercion, and threads force_immutable through ingestion.
darn_core/src/attributes.rs Adds immutable attribute class (and defaults) + updates matching priority + tests.
darn_core/src/atomic_write.rs Improves temp filename uniqueness using random nonce.
darn_core/Cargo.toml Bumps darn_core version to 0.5.0.
darn_cli/tests/cli.rs Makes a couple tests return TestResult and removes expect writes.
darn_cli/src/setup.rs Makes signer setup respect non-interactive modes via Output.
darn_cli/src/output.rs Adds verbosity controls and suppression behavior across output helpers.
darn_cli/src/main.rs Adds --quiet/--silent, threads force_immutable flags, and adds doc subcommand plumbing.
darn_cli/src/commands.rs Wires force_immutable through init/sync/watch, updates porcelain output routing, and implements darn doc edit.
darn_cli/Cargo.toml Bumps darn_cli version to 0.5.0 and adds tungstenite dependency.
Cargo.toml Bumps workspace darn_core version and updates cliclack dependency.
Cargo.lock Lockfile updates for version bumps and new dependencies.
Comments suppressed due to low confidence (1)

darn_core/src/dotfile.rs:60

  • AttributeRules applies default immutable patterns including build/** and dist/**, but the .darn file written by darn init (via DEFAULT_IMMUTABLE) doesn't include those directory-prefix defaults. This makes the on-disk config misleading (behavior differs from what users see in .darn). Consider aligning the defaults by either adding build/**/dist/** to DEFAULT_IMMUTABLE here, or removing them from the compiled-in defaults in attributes.rs and relying solely on the config defaults.
/// Default immutable attribute patterns written on `darn init`.
///
/// These are valid UTF-8 files where character-level CRDT merging would
/// produce semantically invalid results. Stored as LWW strings.
const DEFAULT_IMMUTABLE: &[&str] = &[
    // Source maps
    "*.js.map",
    "*.css.map",
    "*.map",
    // Minified files
    "*.min.js",
    "*.min.css",

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread darn_core/src/attributes.rs
Comment thread darn_core/src/serde_base58.rs
Comment thread darn_core/src/doc_edit.rs
Comment thread darn_cli/src/output.rs Outdated
@expede expede merged commit e1908c0 into main Mar 11, 2026
16 checks passed
@expede expede deleted the cleanup2 branch March 11, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants