Skip to content

fix: three values that reached an output are no longer printed (0.28.1) - #59

Merged
llima merged 12 commits into
mainfrom
fix/printed-recorded-values
Oct 13, 2026
Merged

llima merged 12 commits into
mainfrom
fix/printed-recorded-values

Conversation

@llima

@llima llima commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Version bumped to 0.28.1
  • Merging publishes craftar@0.28.1 to npm after approval in the npm environment
  • A Forge URL with credentials that a release before 0.27.1 recorded in the registry is no longer relayed. craftar workspaces --json gives a fixed label as forge.source and null as forge.key on a missing or an error row; craftar cache prune (paths, warnings, a thrown failure) and the cache check of craftar doctor put the same label where the name of the cache entry such a row names would be.
  • A forge: that holds credentials behind a \ in place of the // is refused, like every URL with credentials. It was read as a path and printed whole by Forge not found at ….
  • A ref: that holds a URL with credentials is not printed by the messages that name a ref, nor by the interactive init, which also refuses one typed as an answer.

Known limit — not closed by this PR

A cache entry that no registered workspace names any more (after the re-sync with a clean URL), and any entry when the registry is off or unreadable, is still printed by its name by craftar doctor and craftar cache prune: nothing in the cache says which entry was named after a refused URL. README › Upgrading › to 0.28.1 says so and what to do.

Contracts and bytes

  • No --json key is added, removed, renamed or retyped (workspaces, cache prune, doctor). Values change: the label in forge.source, null in forge.key for a remote row, the label inside kept[].path / removed[].path / warnings and a cache finding's message.
  • No emitter, planner or lock code is touched: no emitted byte moves, no workspace sees update.
  • One exit code changes: craftar import --write-config on a workspace whose forge: is the backslash spelling with credentials exits 1 (Forge untouched) where it exited 0.

Test plan

  • npm run typecheck — exit 0
  • npm run build — exit 0
  • npx vitest run --exclude test/ci.test.ts --maxWorkers=6 — exit 0: 101 files passed, 1 skipped; 2745 tests passed, 8 skipped
  • oracle: skipped (no fixture); no emitted byte is touched
  • test/ci.test.ts — never part of a by-hand run; this PR's CI is its run
  • test/printed-recorded-values.test.ts (21 cases): against the code before the fix, 12 of the first 15 fail and the other 3 are controls; the cases added by the review rounds each failed on the round before. Every credential is assembled at runtime
  • node-cli-reviewer and docs-author: four rounds, clean on cbc3357
  • Windows: the new tests are path-separator and chmod free by reading; not run on Windows before this CI

llima added 12 commits October 13, 2026 08:24
A Forge URL with credentials that a release before 0.27.1 recorded in the
registry was relayed by workspaces --json, cache prune and doctor's cache
check: a missing or an error row now gives a fixed label and no key, and a
cache entry such a row names is named by the label. A forge: with a backslash
in place of the // after the scheme read as a path and was printed whole in
"Forge not found at"; credentialFault now reads it as it reads the empty
authority. A ref: holding a URL with credentials was quoted by the messages
that name a ref; shownRef gives the label instead.
… credential ref: are not printed

Seven of the ten cases fail on the code before the fix; the other three pin
what must not change (a clean recorded URL, a clean cache entry, drive paths).
Every credential is assembled at runtime.
…e cache entry name that still is

The label changes values of workspaces --json and cache prune --json, and an
entry no registered workspace names any more keeps its name in doctor and
cache prune: both are said where an upgrading user reads.
…resolve gives the label too (review)

A fourth message quoted a ref: holding a URL with credentials — the one
remoteTree words when the remote does not answer and the cached copy cannot
resolve the ref. A plain ref is still named bare there.
… warnings that carry the label (review)

The ref cases called resolveRef only, so the message of a failed fetch went
unseen; and the prune case asserted over an empty removed list. They now go
through loadForgeSource and ensureTree with a git stub, and cover a removed
entry, a removal directory and a held-open warning.
…ill prints an entry name, the fourth ref message (review)

The section claimed no exit code changes and listed three ref messages and
one doctor line; each was short of what the code does.
… credential ref or entry name (review)

The interactive init said a ref: read from craftar.local.yaml as written, and
offered a ref answer back as the next question's default; a failure thrown out
of cache prune, or doctor's unreadable-cache line, carried the path it failed
on, the entry's name in it. Each now goes through the same label.
…a labelled entry (review)

Three cases that fail on the code before: the ref said back from
craftar.local.yaml, the ref answer offered again, and an error thrown with a
path inside an entry named after a URL with credentials.
…at name an entry, exact wording (review)

The ref bullet read as exhaustive and was not; the spellings, the doctor line
and the prune lines were each a little short of the code.
…he refused ref answer when --forge is given (review)

doctor's unreadable-cache line went through hideKeys with no test reaching it,
and the refused ref answer was pinned only where the Forge had been asked. A
comment in cache.ts says why the rewritten error carries no cause.
…ill print an entry's name (review)

A kept entry is printed by name too, and with the registry off doctor names
only the entries whose fetch never completed.
@llima
llima merged commit 7cc9eda into main Oct 13, 2026
8 checks passed
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.

1 participant