Conversation
There was a problem hiding this comment.
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::ImmutableStringand propagate it through ingest/refresh/serialization. - Update
.darnconfig 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
AttributeRulesapplies default immutable patterns includingbuild/**anddist/**, but the.darnfile written bydarn init(viaDEFAULT_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 addingbuild/**/dist/**toDEFAULT_IMMUTABLEhere, or removing them from the compiled-in defaults inattributes.rsand 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.
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.
No description provided.