Skip to content

1.1 audit

This page records the review of the 1.1.0 code base on 2026-11-02. It lists the findings, the evidence, the corrections to the first review report, and the planned 1.1.1 and 1.2.0 work. AUD-1 through AUD-29 are fixed; the 1.1.1 and 1.1.2 items are on their release branches and AUD-4, AUD-8 through AUD-27 are on prep-1.2.0.

The review covered the core parser, model, edits, formatting, sorting, references, resolution, loading, serde support, the CLI, the process crate and the two adapters. The review itself changed no public behavior; the fixes listed here do, and the changelog and upgrading page record them.

The review used these checks:

Terminal window
cargo test --workspace --locked
cargo clippy --workspace --all-targets --locked -- -D warnings
python3 scripts/check_docs.py
cargo llvm-cov --workspace --all-features --locked --summary-only
python3 conformance/check_adotenv.py --setup

It also used a scratch crate outside the repository with targeted cases for loading, resolution, formatting, serde and the CLI. Measurements were taken from release builds on the reference host with /proc/self/status and the resource module.

Baseline evidence:

  • adotenv, adotenv-process and adotenv-cli 1.1.0 are published; the adapters are 0.12.0.
  • The latest CI, Docs, Release and Fuzz runs passed. The only recent failed run was the 1.0.1 release commit, which the next commit replaced.
  • cargo test --workspace --locked passed. cargo test --workspace --all-features --locked also passed during the coverage run.
  • Coverage was 95.75 percent of lines and 95.36 percent of regions. The lowest modules were resolve.rs at 89.9 percent of lines and adotenv-cli/src/main.rs at 94.5 percent.
  • The conformance runner passed 89 cases and 21 profiles: 508 literal observations plus 8 curated Compose resolution observations.
  • adotenv had about 3,500 crates.io downloads and one recorded external adopter, asamarts/alint.

The lossless document model, verified edits, formatting, sorting, comparison and the parser presets held up under targeted and randomized checks. The review found no edit that passed verification but changed unrelated meaning, no parser panic on arbitrary UTF-8, and no UTF-8 boundary or span arithmetic failure. The remaining risks are at the boundaries: loading raw tokens back into a synthetic document, the resolution grammar compared with upstream implementations, CLI file-system and report contracts, and resource use before the existing limits apply.

Status values are open, in progress and fixed. The priority levels are:

  • P0: a silently wrong value or a safety check that does not run.
  • P1: a documented contract is broken or a resource limit can be bypassed.
  • P2: compatibility, user-interface or documentation gap.
  • P3: evidence, release or repository housekeeping.
ID Priority Status Finding
AUD-1 P0 fixed resolve_contextual does not reproduce every loaded key and value exactly
AUD-2 P0 fixed Compose and dotenv-expand operands use shell quote grammar; \${VAR:?} can fail open
AUD-3 P1 fixed fmt --write and set replace files that did not change
AUD-4 P1 fixed Read and replace resolve the path separately, so a symlink swap can redirect a write
AUD-5 P1 fixed diff omits the header and (no differences) for exactly two files
AUD-6 P1 fixed Recursive discovery aborts the run and duplicates differently spelled roots
AUD-7 P1 fixed FinalNewline::Remove with trailing-whitespace trimming is not idempotent at a final lone CR
AUD-8 P1 fixed exec::Shell buffers all output and has no timeout
AUD-9 P1 fixed Resolution allocates the reference list before applying the size limits
AUD-10 P1 fixed parse allocates one diagnostic per occurrence, which amplifies memory
AUD-11 P2 fixed lookup_index sizes its table from entries, not distinct keys
AUD-12 P2 fixed Document::example drops a BOM under Keep and Error
AUD-13 P2 fixed Re-encoding a fragment strips a leading U+FEFF at the fragment start
AUD-14 P2 fixed Mode local reads .env.local twice and reports self-overrides
AUD-15 P2 fixed parse_values omits Compose’s empty-key value
AUD-16 P2 fixed QuotedTail::Append skips tail normalization and the token spans disagree
AUD-17 P2 fixed BOM diagnostics lose to line_byte_limit
AUD-18 P2 fixed Serde flatten errors lose the line and key
AUD-19 P2 fixed adotenv-config dotted keys change the shape of the parent key
AUD-20 P2 fixed Windows environment keys are not checked for case collisions or the value limit
AUD-21 P2 fixed adotenv-process tests mutate the environment from parallel test threads
AUD-22 P2 fixed CLI option, temporary-name and test-assertion gaps
AUD-23 P2 fixed DOTENV_EXPAND had no pinned oracle and differs from dotenv-expand
AUD-24 P2 fixed Secrets documentation omits LineIndex, lookup indexes and the group types
AUD-25 P3 fixed Conformance does not compare resolution with an upstream oracle
AUD-26 P3 fixed Evidence pages and mutation runs are older than the 1.1 code
AUD-27 P3 fixed Repository housekeeping and issue tracker state
AUD-28 P1 fixed encode_value_with rejects a representable Node literal-fallback value at the line cap
AUD-29 P1 fixed Another custom Node encoding false negative found after 1.1.1

AUD-1: contextual loaded resolution is not lossless

Section titled “AUD-1: contextual loaded resolution is not lossless”

LoadedEnvironment::resolve_contextual builds a synthetic file from the raw key and value tokens of the winning declarations (src/load.rs:1340-1358) and parses it with the load dialect. Two inputs change under that rebuild:

Docker file: A=x\r\r\nB=${A}z\n
loaded A: "x\r"
resolve_contextual A: "x" (wrong; the CR joins the appended LF)
resolve_contextual B: "xz"
resolve_decoded A: "x\r" (correct)
resolve_decoded B: "x\rz"
Python file: # c\n\u{feff}B=1\nA=${B}\n
loaded keys: ["\u{feff}B", "A"]
resolve_contextual keys: ["A", "B"], A = "1"

The first synthetic declaration sits at byte 0, so BomPolicy::Strip removes a U+FEFF that belongs to the key. A key that is exactly U+FEFF makes the whole rebuild fail with dotenv.invalid-key instead. Before 1.1.1, resolve_contextual had no exact round-trip check, unlike resolve_decoded (src/load.rs:1195-1212).

The fix starts the synthetic source with a blank line, adds one CR before the line feed when a raw value ends with CR in an LF-only dialect, and verifies every parsed key and value against the loaded record. A key or value that cannot be reproduced is an error naming the key. The regression tests cover Docker trailing CR, Python and Docker leading U+FEFF keys, a key that is only U+FEFF, a bare key read as empty, and the existing quote and escape cases. Fixed on the prep-1.1.1 branch in src/load.rs with tests in src/load_tests.rs.

AUD-2: Compose and dotenv-expand operands used shell grammar

Section titled “AUD-2: Compose and dotenv-expand operands used shell grammar”

Reference scanning used to treat ', " and \ inside ${...} as shell quoting. Compose and dotenv-expand stop the operand at the first } outside a nested form and do not remove quotes. Because an unclosed reference is not eligible, the scanner left it literal:

source: A=${B:-do'nt}
adotenv compose: "${B:-do'nt}"
compose-go 2.16.1: "do'nt"
source: A=${B:?can't continue}
adotenv compose: literal, no error
compose-go 2.16.1: error

The second case was a required-variable check that did not run. The same grammar changed A=${B:-a\}b} and A=${B:-\$C}. The fix uses operand grammar for brace frames (first } outside a nested form; quotes and backslashes are ordinary characters) and keeps shell grammar only inside $() frames. A backslash before a nested $ in an operand is now ordinary text, so A=${B:-\$C} expands the nested variable and keeps the backslash, matching the Compose oracle. Reference::escaped and ReferenceRules::escaped_dollar were updated: escaped contexts are double-quoted values and command payloads, not brace operands.

Fixed on the prep-1.1.1 branch. Tests in src/reference_tests.rs and src/resolve_tests.rs record the Compose 5.6.0 / compose-go 2.16.1 observations for do'nt, "quoted", a\}b, \$C, \${C} and the :? message. A focused differential run of 130 operand, quote, backslash, brace and required-message cases against the pinned Compose oracle found no mismatches when resolution used Unresolved::Empty. Short fuzz runs of the resolve and format targets after the change completed without a crash. A curated Compose resolution profile was later added under AUD-25.

ExpandOptions::dotenv_expand() is documented as an adotenv rules preset, not exact emulation. dotenv-expand 1000.0.0 is pinned and recorded under AUD-23.

The same unresolved-reference difference applies to ExpandOptions::compose(): Compose substitutes empty for an unset name inside a default, while the preset keeps it literal. The resolution profile uses inputs with every name set or a default, and the documentation says that ReferenceRules::COMPOSE does not emulate Compose interpolation as a whole.

fmt --write called write_atomic without comparing the output with the source. Verified with an already formatted file: the inode and modification time changed. In a read-only directory the command exited 2 even though no write was needed. docs/design/cli.md says --write rewrites changed files. set had the same unconditional write.

The fix adds a no-change guard to both commands. Tests in adotenv-cli/tests/cli.rs cover an unchanged formatted file in a read-only directory and inode and hard-link preservation. docs/design/cli.md and the upgrading page record the behavior. Fixed on the prep-1.1.1 branch.

AUD-4: read and replace resolve the path separately

Section titled “AUD-4: read and replace resolve the path separately”

fmt --write and set used to read the path with read_text, then write_atomic canonicalized a symbolic link again and renamed over the result. There was no device and inode check. A symlink swap between the read and the replace could send file A’s content to file B. The recursive walker checked the link and then read a path that could be replaced by a link.

The fix resolves the write target with fs::canonicalize once before reading, reads through that target, and checks the target’s identity before creating the temporary file and again immediately before the rename. A checked write does not resolve symbolic links again, so a link that appears at the resolved target cannot redirect the temporary file. On Unix the identity is the device and inode pair; other platforms still use the resolved target without a device/inode check. A replaced target, or a symbolic link at that path, fails with “file changed after it was read”. Tests in adotenv-cli/src/main.rs cover the identity rejection and the swapped-link case; the existing symlink integration tests cover the target and link behavior. Fixed on prep-1.2.0.

diff_streaming set multi = paths.len() > 2, so the baseline -> file header and (no differences) only appeared with three or more files. Verified: diff base.env same.env printed nothing and exited 0; diff base.env diff.env omitted the header. docs/design/cli.md promises both for every candidate and uses two files in its example.

The fix emits the header for every human-output candidate and prints (no differences) when the comparison is empty. Tests in adotenv-cli/tests/cli.rs cover two identical files, two different files and standard input as the baseline. Fixed on the prep-1.1.1 branch.

AUD-6: recursive discovery aborted and duplicated roots

Section titled “AUD-6: recursive discovery aborted and duplicated roots”

walk_env_files returned the first read_dir error and check returned before producing a report. With one unreadable subdirectory, check --format json -r walk exited 2 with empty standard output. That broke the stable JSON report and the rule that check and fmt process every file. Separately, check -r . sub reported ./sub/.env and sub/.env as two files, although the report says found files are deduplicated.

The fix collects discovery errors instead of returning the first. check reports them as human stderr, JSON files entries with ok:false, or GitHub annotations; fmt reports them on stderr. Both commands continue with the remaining paths and exit 2. After sorting, found paths are deduplicated by fs::canonicalize, so different spellings of one file appear once. Tests in adotenv-cli/tests/cli.rs cover a missing root, an unreadable directory, fmt continuation and differently spelled roots. docs/design/cli.md describes the reporting and deduplication. Fixed on the prep-1.1.1 branch.

AUD-7: formatting was not idempotent at a final lone CR

Section titled “AUD-7: formatting was not idempotent at a final lone CR”

plan_trailing_whitespace left lines that end with or follow a lone CR alone. plan_final_newline then removed that same CR with FinalNewline::Remove. The next format pass trimmed the whitespace that the first pass preserved:

U="multi\nline" \r -> U="multi\nline" -> U="multi\nline"
# comment \r -> # comment -> # comment

This contradicted the FormatResult example and the next-parse guarantee. A short format fuzz run also found a second case: in an LF-only dialect, removing one final CR can expose another CR as a new line ending, so further passes kept removing CRs.

The fix adds a final-CR trim that cooperates with FinalNewline::Remove, and leaves the file unchanged when the remaining text would still end with a line ending. The property test and the format fuzz target now assert idempotence for Remove too. Regression tests cover a final CR with trailing whitespace, a multi-line value, comments, CRLF, spaces inside quotes, a blank final line and several CRs in Compose. A 120-second format fuzz run after the fix executed 11,076 inputs without a crash. Fixed on the prep-1.1.1 branch.

src/exec.rs used Command::output(), which buffered the complete standard output and standard error before resolution checked the result. A command that printed without end could exhaust memory, and a command that never exited blocked resolution. The documentation already limited this helper to trusted files, but the resolution limits could not contain a trusted command that ran away.

The fix streams both pipes, keeps at most 1 MiB of standard output and 64 KiB of standard error, and stops a command after 300 seconds by default. with_max_output_bytes, with_timeout and without_timeout change those limits. The command is killed on a limit or timeout; reader threads are detached if a descendant keeps a pipe open. Tests in src/exec.rs cover the output cap and timeout. Fixed on prep-1.2.0.

AUD-9: resolution scanned before applying limits

Section titled “AUD-9: resolution scanned before applying limits”

src/resolve.rs built the reference list before the value-size check. A Reference is about 152 bytes, so dense references allocated much more than the input. Measured in a release build before the fix:

Value Peak RSS
0.8 MB of \${M:-$A} repeated 71.7 MB
1.6 MB of the same 141 MB

Both cases happened before max_value_bytes or max_output_bytes could reject. Entry::references() has the same profile.

The fix scans into a bounded list. ExpandOptions::max_references defaults to 65,536 candidates and can be changed with with_max_references. The scanner stops at the limit and resolution fails with ResolveError::TooManyReferences before the list grows further. The public Entry::references API stays unbounded, and its documentation now states the per-candidate memory cost and points at the resolution limit. sort also uses the unbounded API; callers that sort untrusted documents should bound them first (in 1.8.0, Document::sort_with_options with EditOptions::max_references closes this caveat). Tests cover the exact limit, a zero limit, the structured error and a dense scan. Fixed on prep-1.2.0.

src/parser/decode.rs created a TightHash or Backtick diagnostic for every character, and the lone-CR merge created one LoneCarriageReturn diagnostic per CR. A 1 MB value of # used 58 MB in parse against 13.8 MB in parse_values, with one million diagnostics. adotenv-cli check uses parse_with, so an adversarial file could exhaust memory in a linter.

The recovery parser now stops adding ordinary diagnostics at 10,000. Both the direct parser pushes and the lone-CR merge share that budget, and a final DiagnosticCode::TooManyDiagnostics warning reports truncation with a span at the end of the source. The first error found after the budget is retained, so truncation cannot hide a failure. parse_strict and parse_values use the non-diagnostic parser path and still return the first error without collecting the list. A release-mode regression parses a 1 MB tight-hash value and checks the cap within a 16 MiB growth budget. Tests in src/diagnostic_tests.rs cover the cap for repeated value warnings and lone CRs. Fixed on prep-1.2.0.

The hash table was sized from document.entries().len(), not from the number of participating keys. A file of 200,000 Node bare keys produced an index with len() == 0 that allocated about 12 MB.

The table now starts with eight slots and doubles as participating keys are inserted, preserving the 3/4 load factor. Declarations excluded from lookup, such as Node bare keys, allocate only the initial table. A collision-heavy input still falls back to the ordered map. Tests check that ignored entries leave the table at eight slots and that a thousand distinct keys grow it and remain addressable. Fixed on prep-1.2.0.

docs/design/comparison.md promises that an example keeps a BOM. Document::example kept it under BomPolicy::Strip, but under Keep the first declaration was commented out as a whole and under Error the invalid BOM item became #, losing the three bytes.

The fix emits a leading BOM once when it is part of an item, then adjusts the first item’s span and content range so the mark is not copied twice. The declaration still becomes a comment or an empty assignment, and no value text is retained. Tests cover Strip, Keep, Error and a Node Keep entry. Fixed on prep-1.2.0.

Context::verify parsed before + token + after as a fragment. Because the fragment starts at the item start, a leading U+FEFF was read as the file’s BOM and stripped. A key that was exactly U+FEFF gave EditError::Unencodable from set, and format silently left the value unquoted.

Native verification now parses the fragment after a leading sentinel newline and shifts the token range by its length. The U+FEFF therefore remains part of the key instead of becoming a fragment BOM. Tests cover set and quote formatting for a key that is only U+FEFF after a comment. Fixed on prep-1.2.0.

load_cascade_with_options builds .env, .env.local, .env.{mode} and .env.{mode}.local (src/load.rs:1689-1694); load_cascade_values_with repeats it (src/load.rs:1862-1867). Mode local is valid (src/load.rs:1960) and produces .env.local twice. Values are unaffected, but entries() and overrides() report the same file overriding itself. Deduplicate the path list while preserving order.

AUD-15: parse_values and Compose’s empty key

Section titled “AUD-15: parse_values and Compose’s empty key”

Compose accepts an empty key, as in =x or a bare last line. Document::get("") returns that value, but parse_values skips it because it follows Document::effective_entries, which excludes empty keys. The loader also skips empty keys.

The values-only API keeps that behavior. Its documentation, the parsing guide and the audit now state the exception explicitly, and a test checks that Document::get("") sees the value while parse_values omits it. Fixed by documentation on prep-1.2.0.

The appended tail was added after the decode loop without normalize_newlines or the Portable # and backtick warning scan. EntryTokens::value and body cover only the quoted token, while Entry::value() and value_span() include the tail.

The tail now uses the same newline normalization and Portable warning scan as the quoted body. The token documentation states that value and body cover the quoted token, quoted_tail holds the appended text, and Entry::value_span covers both. Tests cover a normalized CR tail, a tight hash warning in the tail and the three token ranges. Fixed on prep-1.2.0.

AUD-17: BOM diagnostics and the line limit

Section titled “AUD-17: BOM diagnostics and the line limit”

When the first line exceeds line_byte_limit, the resource rejection runs before BOM interpretation. BomPolicy::Strip then reported no ByteOrderMark diagnostic and BomPolicy::Error reported no ForbiddenByteOrderMark; the whole line became one LineTooLong item, and the public docs did not state the precedence.

The precedence is intentional: an oversized line is rejected before its contents are interpreted. BomPolicy, the BOM diagnostic docs, the dialect guide and the diagnostics table now state that LineTooLong wins. A policy-matrix test covers Strip, Keep and Error, has_bom() == false, and the single LineTooLong diagnostic. Fixed by documentation on prep-1.2.0.

with_context is applied in EntriesAccess::next_value_seed. Flattened fields are decoded later by serde, so a conversion error from deserialize_any reported line 0 and no key. Verified with #[serde(flatten)] rest: BTreeMap<String, u16> on a=x.

The values are still decoded as strings and the conversion error is retained; only the location is unavailable through serde’s flattened path. The DeserializeError type, both deserialize methods and the serde guide now document that values consumed through #[serde(flatten)] report line 0 and no key. A regression test pins the behavior. Fixed by documentation on prep-1.2.0.

The adapter inserts keys unchanged into config::Map. config reads . as a nested path. With A=1 and A.B=2, get_string("A.B") works, but A becomes a table and get_string("A") fails with a type error. The module documentation mentioned the separator but not the change of shape.

The adapter keeps its pass-through behavior. The crate docs, README and integration guide now state the scalar-parent/dotted-child collision and that the winner is a config implementation detail. A regression test checks that both shapes cannot be read from one source. Fixed by documentation on prep-1.2.0.

adotenv-process::validate and the CLI copy rejected empty keys, = and NUL. Windows environment blocks are case-insensitive, so Path and PATH both passed and one won by sort order. The process value length limit was also not checked.

On Windows, both paths now reject keys that collide after lowercasing and values longer than 32,767 UTF-16 code units. ApplyError gained DuplicateKey and ValueTooLong; the CLI reports equivalent errors before starting a child. Tests are Windows-gated, and the CLI and process test targets cross-check for Windows. Unix behavior is unchanged. Fixed on prep-1.2.0.

The unit tests called unsafe { apply(...) } and read the environment while other tests ran in the same test binary. cargo test runs tests in parallel, so the suite exercised the race the crate documents as the caller’s responsibility.

The environment-touching tests now serialize on a test-only mutex. Doc tests run in a separate process, and only the apply example touches the environment. The test-only lock does not change the public API. Fixed on prep-1.2.0.

  • A repeated --dialect left the second pair to the path parser, and --dialect=node was treated as a path.
  • An unknown option such as --jsn was treated as a path.
  • fmt --write --check with an empty directory exited 0 before the conflict check.
  • A temporary name using the full file name could exceed NAME_MAX.
  • Weak tests: one JSON test did not parse the JSON; the documented-schema test skipped when the docs file was absent; the temporary-file test removed the directory before asserting the temporary was gone; write failure coverage depended on enforced permissions.

--dialect=<value> is now accepted, repeated dialects are a usage error, and unknown -- options are rejected instead of treated as paths. The fmt conflict is checked before discovery. Temporary names keep at most 160 bytes of the original stem plus the PID/counter suffix. JSON assertions parse the wire format, the schema test requires docs/design/cli.md, the temporary-file test asserts while the directory exists, and a deterministic directory-target unit test covers write failure. Fixed on prep-1.2.0.

The preset is named after dotenv-expand but had no pinned version or oracle. The pinned dotenv-expand 1000.0.0 behavior differs from adotenv: it leaves ? forms empty, substitutes empty for unresolved names, and has its own $$ and escape handling.

dotenv-expand 1000.0.0 is now pinned in conformance/node/package-lock.json and declared in node/profiles.json. A node-dotenv-expand profile records its expansion behavior against the controlled corpus; command-substitution cases are marked as errors without execution. The preset documentation states that ExpandOptions::dotenv_expand() is an adotenv rules choice, not exact emulation, and the conformance manifest records the known differences. Fixed on prep-1.2.0.

LineIndex derived Debug over the source, LookupIndex/EffectiveEntry carried document values, and Group/Groups derived Debug over document items. The secrets warning in the crate documentation, docs/reference/security.md and README.md now names these types. They also implement the opt-in Mask form alongside the other core value-bearing types, so mask(&index), mask(group) and mask(&groups) redact the source. Fixed on prep-1.2.0.

AUD-25: conformance does not compare resolution

Section titled “AUD-25: conformance does not compare resolution”

The conformance runner compared literal parser output. For Compose it excluded sources containing $, and the Rust probe called parse_with, not resolve. The corpus therefore did not exercise resolution as a whole.

The conformance corpus now has curated resolution cases for basic references, controlled external lookup, defaults and alternatives, nested defaults, quote and backslash handling, $ in operands and :? errors. The Rust probe exposes a compose_resolve profile that calls Document::resolve with ExpandOptions::compose(), and the checker compares it with the pinned Compose parser observations. Compose $$ escaping remains a documented discrepancy and is not asserted. Fixed on prep-1.2.0.

docs/design/performance.md and docs/design/test-audit.md described 1.0.0. The performance page now has a 1.2.0 development-host smoke record, the test audit has a fresh coverage table for the branch, and focused mutation testing covers the security, masking, command-limit, diagnostic and Windows-validation modules. Five local 10-second fuzz campaigns passed; the encoding harness was hardened after a line-cap false positive. The four-workflow-run release rule still applies after merge, so that remains release evidence rather than a branch gate. Fixed on prep-1.2.0.

The local main branch is synchronized with origin/main at ec6a4cf. Local branches prep-0.11, prep-1.0, prep-1.1.1 and pr3-criterion were removed after their release or upstream state was confirmed; release tags remain. Issue 13 was closed with a comment pointing to the 1.0 readiness record and the current audit page. Issue 14 remains open for the linter and LSP companions. Fixed on prep-1.2.0.

AUD-28: encoding false negative at a Node line cap

Section titled “AUD-28: encoding false negative at a Node line cap”

The scheduled encoding fuzz run on 1.1.0 failed on a custom Node dialect with QuotedTail::LiteralFallback, a line limit of 18, and a value whose legal token ends in an escaped tab. The token read back as the value at both LF and EOF, but encode_value_with returned EncodeError::Unrepresentable because the shortest inverse token ended in a raw tab that the parser trims at EOF.

The fix tries the escaped spelling of a trailing control character in the Node literal-fallback path before the inverse search. A unit test in src/encode_tests.rs covers the value and dialect. The fuzz target now also requires an EOF witness before asserting the inverse, so it does not demand a standalone encoding for a token that depends on a trailing LF. Encoding fuzz ran 104,703 executions without a crash. Fixed on the prep-1.1.1 branch.

AUD-29: another custom Node encoding false negative

Section titled “AUD-29: another custom Node encoding false negative”

The third post-release fuzz run found a second encode_value_with false negative in a custom Node dialect. The failing value contains NULs, U+2028, U+2029, backticks and A="#; the dialect uses QuotedTail::Error, universal line breaks, backticks: true, double_escapes with only \, and a 98-byte line cap. A legal token read the value at both LF and EOF, but encode_value_with returned EncodeError::Unrepresentable.

The witness relied on Node backtick quote recovery: seven backticks read as five. The fix tries a longer run of backticks as a final verified candidate. encode_tests::node_backtick_recovery_at_the_line_cap covers the artifact value and dialect. The encoding fuzz target ran 57,837 executions after the fix without a crash. Fixed in 1.1.2.

Reproducer:

artifact: fuzz/artifacts/encoding/crash-aca3cbd748dee10721e0b39e0049353974989c9c
base64: UQRgW2AABAAAQwAnAOKAqGBgYGBgYGDigKlBPSIj

These points in the first report were wrong or imprecise and are corrected here:

  1. adotenv-config: the first report said A.B was unreachable and get_table("A") failed. In fact a scalar A and a dotted A.B collide: config exposes one shape or the other depending on its source-map iteration, not both. The finding is the ambiguous shape change, not a missing child key.
  2. CLI JSON test: the first report said the first disjunct of assert!(!json.contains('\n') || json.lines().count() == 1) is always false and the test never validates JSON. The assertion does check a line count; it does not parse the JSON. The weaker point is the missing parse.
  3. --dialect=node: the first report implied a documented option form. Only --format=<value> is documented. Treat --dialect= as a consistency gap, not a broken contract.
  4. resolve_contextual and LF-only dialects: the first report generalized the trailing-CR loss to all LF-only dialects. Compose reads A=x\r\r\n as x, so the observed loss is specific to Docker and other raw-value LF-only dialects.
  5. Document::example and the BOM: the first report said the BOM is dropped. Under Keep the whole first declaration is commented out, and under Error the invalid item becomes #; both lose the BOM. State the full effect.
  6. QuotedTail::Append: the token span is the quoted token only, while the entry span includes the tail. The first report described this correctly, but the tail is also not normalized and is not scanned for warnings. Keep both parts together.
  7. DOTENV_EXPAND: the first report stated a difference as a fact without a version. The observation is against dotenv-expand 1000.0.0. The actionable item is the missing pin and oracle.
  8. parse trie memory and Reference::argument were raised during the review and then dropped after verification. The trie measurement was not reproduced with shared key prefixes, and ${VAR:-} returns Some(7..7), not None. They are not findings.
  9. The first report did not mention that every ExpandOptions preset keeps unresolved references literal, while Compose and dotenv-expand substitute empty. This is a documented choice for the rules presets, but the resolution resolution profile selects inputs where every name is set or has a default.
  1. AUD-1: contextual loaded resolution exactness. Fixed on the prep-1.1.1 branch.
  2. AUD-2: Compose and dotenv-expand operand grammar, with oracle-backed tests. Fixed on the prep-1.1.1 branch.
  3. AUD-3: no-change guard for fmt --write and set. Fixed on the prep-1.1.1 branch.
  4. AUD-5: diff header for two files. Fixed on the prep-1.1.1 branch.
  5. AUD-6: recursive discovery reporting and deduplication. Fixed on the prep-1.1.1 branch.
  6. AUD-7: FinalNewline::Remove idempotence. Fixed on the prep-1.1.1 branch.
  7. AUD-28: encoding false-negative at a Node line cap. Fixed on the prep-1.1.1 branch.

Each fix needs a regression test. The release also needs the full gate, check_docs.py, conformance, and a fuzz run. The 1.0.1 patch precedent covers behavior fixes in a patch release.

Checks on the current branch:

Check Result
Workspace tests, all features Pass
Core unit tests Pass, 364 tests
Crate-level regression integration tests Pass, 3 tests
CLI integration tests Pass, 77 tests
Format property test with Remove idempotence Pass, 2,000 cases
Format fuzz Pass, 11,076 executions after the AUD-7 fix
Encoding fuzz Pass, 104,703 executions after the AUD-28 fix
Clippy, all targets and features Pass
Rustdoc Pass
Documentation links and page check Pass
Conformance Pass, 508 literal + 8 resolution observations
cargo audit --deny warnings Pass
cargo deny check Pass
cargo semver-checks check-release Pass for the four libraries
cargo package Core crate verified; companion file lists verified, with full companion packaging after core 1.1.1 reaches crates.io

Released as v1.1.1 on 2026-11-02:

  • The three lockstep crates declare 1.1.1 in their manifests.
  • Cargo.lock, the path requirements and conformance/rust/Cargo.lock are updated.
  • The Unreleased changelog entries moved to [1.1.1] - 2026-11-02.
  • CI passed on main, including the macOS rerun after a runner-capacity cancellation.
  • The release workflow passed its CI gate, published adotenv, adotenv-process and adotenv-cli 1.1.1, and created the GitHub Release.
  • crates.io, docs.rs and the GitHub Release were verified.

Post-release work:

  • The documentation site deployment succeeded after the earlier Pages deployment cleared.
  • Post-release fuzz evidence on 2026-11-02: three of four runs passed. Run 41520885250 (20:37 UTC), 41521941059 (20:44 UTC) and 41523932218 (20:57 UTC) passed. Run 41522938132 (20:50 UTC) failed in the encoding target with AUD-29, so the four-clean-run evidence is not complete.
  • Performance and test-audit evidence are refreshed on this branch.
  • AUD-29 is fixed in 1.1.2. Four clean fuzz runs are recorded. The tag and publication completed.
  • AUD-29: fixed. The regression test and a 57,837-execution encoding fuzz run pass. Four clean release fuzz runs are recorded:
    • 41548264191, 2026-11-02 23:48 UTC, passed
    • 41549097150, 2026-11-02 23:55 UTC, passed
    • 41549898098, 2026-11-03 00:02 UTC, passed
    • 41550765651, 2026-11-03 00:09 UTC, passed All five targets passed in every run.
  • Tagged v1.1.2 and published adotenv, adotenv-process and adotenv-cli 1.1.2 on 2026-11-03. The release workflow and GitHub Release passed; crates.io was verified. docs.rs builds were still pending when this page was updated.
Check Result
Workspace tests, all features Pass, 365 core tests
Regression and CLI integration tests Pass, 3 and 77 tests
Clippy, rustdoc, formatting and docs Pass
Conformance Pass, 508 literal + 8 resolution observations
cargo audit, cargo deny, semver checks Pass
Four workflow fuzz runs Pass, all five targets in every run
crates.io and GitHub Release Verified
docs.rs Builds pending
  • AUD-4: identity check for reads and replaces. Fixed on prep-1.2.0.
  • AUD-8: bounded exec::Shell output and timeout. Fixed on prep-1.2.0.
  • AUD-9: bounded reference scanning before resolution limits. Fixed on prep-1.2.0.
  • AUD-10: diagnostic budget and truncation summary. Fixed on prep-1.2.0.
  • AUD-11: lookup-index growth from participating keys. Fixed on prep-1.2.0.
  • AUD-12: example BOM preservation under Keep and Error. Fixed on prep-1.2.0.
  • AUD-13: fragment verification keeps a leading U+FEFF key. Fixed on prep-1.2.0.
  • AUD-14: mode local loads its local file once. Fixed on prep-1.2.0.
  • AUD-15: values-only parsing documents its empty-key exception. Fixed on prep-1.2.0.
  • AUD-16: appended tails normalize and scan like the quoted body; token spans are documented. Fixed on prep-1.2.0.
  • AUD-17: document that line limits take precedence over BOM diagnostics. Fixed on prep-1.2.0.
  • AUD-18: document that serde flattened values lose line and key context. Fixed on prep-1.2.0.
  • AUD-19: document the adotenv-config dotted-key table collision. Fixed on prep-1.2.0.
  • AUD-20: Windows key-case collisions and value limits. Fixed on prep-1.2.0.
  • AUD-21: serialize process-environment tests. Fixed on prep-1.2.0.
  • AUD-22: CLI option parsing, temporary-name bounds and test gaps. Fixed on prep-1.2.0.
  • AUD-23: pin dotenv-expand and record its profile and known differences. Fixed on prep-1.2.0.
  • AUD-25: curated Compose resolution conformance profile. Fixed on prep-1.2.0.
  • Value masking for Debug, diff and serde errors. Fixed on prep-1.2.0; see After 1.0.
  • AUD-24: secrets documentation names LineIndex and the group types. Fixed on prep-1.2.0.
  • AUD-26: performance, coverage, mutation and local fuzz evidence refreshed for 1.2.0. Fixed on prep-1.2.0; release-time four-run fuzz evidence remains a release step.
  • AUD-27: issue 13 closed, stale local branches removed and main synchronized. Fixed on prep-1.2.0.
  • Tagged v1.2.0 at bf4b393 and published adotenv, adotenv-process and adotenv-cli 1.2.0 on 2026-11-05. The release workflow 41944509116 passed its quality gate, publish job and GitHub Release job.
  • crates.io reports 1.2.0 for the three lockstep crates. The adapters remain 0.12.0.
  • Four workflow fuzz runs passed on the release commit, all five targets in every run:
    • 41941036521
    • 41941908663
    • 41942723663
    • 41943612879
  • The GitHub Release v1.2.0 is published. docs.rs build 5162396 completed successfully for adotenv and adotenv-process; the adotenv-cli binary redirects as expected. docs.rs/adotenv/latest now serves 1.2.0.

adotenv-config and adotenv-figment stay at 0.12.0. Their code is unchanged since 1.0, their adotenv requirement is the compatible 1.0.0 line, and no adapter API changed in 1.2.0, so they do not need a release for this version. Adapter Debug output continues to include values and is documented as such; masking adapters was not added because the adapters are value-exposing sources, not reports, and the core Masked API already covers the report types.

The adotenv-lint prototype now lives in the workspace as a separate 0.1.0 crate. It returns structured findings, applies fixes through verified adotenv edit/format APIs, has a report/fix CLI and reads project configuration; it does not add policy to the parser. Version 0.1.0 was published on 2026-11-06, and 0.1.1 was the first release published through crates.io Trusted Publishing. The adotenv-lsp 0.1.0 prototype now lives in the workspace as a separate crate with diagnostics, completion, definition, hover, references, rename and a stdio server. Keep lint policy and editor protocol work out of the core.

Done on prep-1.2.0: focused mutation testing covers the new modules; issue 13 is closed; prep-0.11, prep-1.0, prep-1.1.1 and pr3-criterion were removed; and main is synchronized with origin/main. Issue 14 remains for the linter and LSP companions.

Commands used for the measurements in this page:

Terminal window
# coverage
cargo llvm-cov --workspace --all-features --locked --summary-only
# conformance
python3 conformance/check_adotenv.py --setup
# memory, release build, value of 100,000 and 200,000 repeated ${M:-$A}
./target/release/mem4 resolve 100000
./target/release/mem4 resolve 200000
# diagnostics, 1 MB value of #
./target/release/mem2 warn_parse
./target/release/mem2 warn_values
# lookup index, 200,000 Node bare keys
./target/release/mem2 bare_parse
./target/release/mem2 bare_index

Compose observations were taken with the pinned conformance/.build/go-oracle binary (Compose 5.6.0, compose-go 2.16.1, Docker CLI 29.8.2). The dotenv-expand observation used dotenv-expand 1000.0.0 from npm.

The Compose operand differential used 130 cases: 30 operand spellings with each of :-, -, :+ and +, plus five messages with each of :? and ?. Each source was A=${M...}, with M unset and C=see in the controlled lookup. The probe parsed with Dialect::COMPOSE and resolved with ExpandOptions::compose(), whole-file scope and Unresolved::Empty; it compared values and error presence with compose-parser-default.

The short fuzz runs used:

Terminal window
cargo +nightly fuzz run --target x86_64-unknown-linux-gnu resolve -- \
-max_total_time=45 -timeout=10 -rss_limit_mb=2048
cargo +nightly fuzz run --target x86_64-unknown-linux-gnu format -- \
-max_total_time=45 -timeout=10 -rss_limit_mb=2048

The scratch crate and generated files are outside the repository and are not part of the commit.