Skip to content

One repository may hold both memory scopes, and the gates now know it - #93

Merged
spscream merged 1 commit into
mainfrom
fix/private-scope-in-one-repository
Sep 17, 2026
Merged

spscream merged 1 commit into
mainfrom
fix/private-scope-in-one-repository

Conversation

@spscream

Copy link
Copy Markdown
Owner

Reported from the fleet checkout: run commit refused to commit fifteen changed files in the private scope, each named as not changed: wrong path, or the edit was lost, while git status in the store listed every one of them.

The layout

A project that cannot commit notes next to its code — a fork kept for upstream PRs — points public_repo and private_repo at the same repository. The scopes do not collide: they sit at public/projects/<key> and private/projects/<key> inside it. store, workplace and link all wire it and all report success. Only the checks did not cover it.

The cause

FLOPPY_PRIVATE_STORE was derived by asking whether the private scope's repository differs from the memory store — identity, where the question is containment. The memory scan reaches what lies under FLOPPY_MEMORY_REAL; a sibling prefix in the same repository is not under it. So the variable was blanked, scan_scope returned on its first line, and every file in the scope wore the message for a typo.

_derive_common next to it has always used containment, and says so in its own comment: common/shared normally resolves into the memory's own store.

What is in the change

lib-config.sh containment instead of identity
wrap-commit.sh one repository is one commit — before this, both scopes in one clone meant two commits with the same message, two pushes, and two sections naming the same path
wrap-guard.sh a scope no store covers is told so, with the path it resolves to; the scan returns silently on an empty store, so a future blanking would wear the typo message again
memory-lint.sh [[ -n "\$x" ]] in a note is no longer read as a link — a hard error that took check and the commit with it, inline or fenced

Verification

Each half was reproduced before the fix and pinned after it:

  • tests/test-external-memory.sh — the one-repository shape end to end: both links wired, FLOPPY_PRIVATE_STORE equal to the memory store, guard accepting a private note, and a commit spanning both scopes landing as one commit with both paths in the remote. Plus the half-wired shape, asserting the honest message.
  • tests/test-memory-lint.sh — a note quoting a bash condition passes, and the positive control that a dangling [[slug]] still fails.

Suite: 23 files, 1018 assertions (+17), 0 failed on /bin/bash.

Released as 0.25.1; the shim is untouched, so the changelog answers "Refresh .floppy/run?" with no.

Not reproduced, and not changed: the reporter also saw git status --porcelain collapsing a new scope directory into one ?? line. With the store ignoring the wiring link the way workplace leaves it (ignore_wiring_link), that line does not appear; scan_scope already passes --untracked-files=all.

A project that cannot commit notes next to its code points public_repo and
private_repo at the same repository; the scopes still do not collide, because
they sit at public/projects/<key> and private/projects/<key> inside it. Every
wiring verb builds that layout and reports success — and nothing checked it.

FLOPPY_PRIVATE_STORE was derived by asking whether the private scope's
repository DIFFERS from the memory store, which there it does not, so the
variable was blanked, wrap-guard's scan returned on its first line, and each
of fifteen changed files came back as "not changed: wrong path, or the edit
was lost". The reader spent several iterations on their own paths before
running `env`. What decides coverage is containment, not repository identity:
the memory scan reaches what lies under the memory scope, and a sibling prefix
is not under it. _derive_common has always used containment and says so.

Two consequences travel with it. One repository is one commit: the scopes
merge where the unit stops being a scope and becomes a repository, instead of
writing two commits with one message and pushing twice into one clone. And an
unscanned scope now says so, with the path it resolves to — the scan returns
silently on an empty store, so any future blanking would wear the typo message
again.

Separately: the link scan took everything between [[ and ]], so a bash
condition in a note failed the run as a dangling slug, inline or fenced. A
slug never contains whitespace and a condition always does. The positive
control pins that a misspelled slug still fails.

Released as 0.25.1. Suite: 23 files, 1018 assertions, 0 failed on /bin/bash.
@spscream
spscream merged commit f999cb2 into main Sep 17, 2026
4 checks passed
@spscream
spscream deleted the fix/private-scope-in-one-repository branch September 17, 2026 22:53
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