Skip to content

facts: re-check follow-ups - #1067

Merged
scuttletoby merged 1 commit into
mainfrom
facts-followups
Nov 23, 2026
Merged

scuttletoby merged 1 commit into
mainfrom
facts-followups

Conversation

@scuttletoby

Copy link
Copy Markdown
Owner

Follow-up to #1065 (the facts command, #1063). It fixes the points the re-check review found after the merge.

What

  • Project name (facts.py project_name):
    • A name taken from a match that ends in /. or /.. (or is only /) goes through the same name rule as the config's name key. If it fails, the row gets no record folder. Before, /srv/example/.. gave .., so the search would have looked at the repo's root.
    • A remote match ending in .git (github.com/example/project.git) gives project. A folder match keeps its name as it is.
  • Links out of the repo: projectsDir or a shared folder that is a link to a place outside the record repo is not searched. Its real path must be inside the repo's real path. A record repo that is itself reached by a link still works.
  • Time limit: the 10 s limit is now checked for each folder as well as each file, so a tree of empty folders cannot run past it.
  • Binary files: a file with a NUL byte is skipped, whatever its extension.
  • facts --records:
    • When the only hits are in a mirrored copy of a state table, it says so and names each copy and the table it copies. It also points to facts --no-records <words> for the rows. Before, it said "no line holds all of".
    • With no record repo configured, it prints one note: line and exits 0.
  • Uninstall: the "code of this kit is in use" check no longer counts an OPTIONAL_LINKS path that belongs to another program. A program running from an unrelated /usr/local/bin/facts no longer blocks uninstall. Our own link still does.
  • README: a note that installing a release from before facts existed leaves a link to a file that is not there, until a newer release is installed or the kit is uninstalled.

General vs project

  • General (this PR): fixes to the general facts command, its record search and the shared installer. No project, person, path or machine is named. Tests use temp folders and /srv/example/... and github.com/example/... names.
  • Project / machine (not in this PR): none. Each machine's own file still sets the tables and record repos.

Tests

  • fork-kit/agent-guards/tests/facts.test.py: 47 tests, up from 42. Covered:
    • project names from ., .., / and .git matches;
    • a projectsDir and a shared folder linked out of the repo;
    • a record repo reached through a link;
    • a NUL-byte file;
    • the per-folder time check;
    • --records when only a mirrored copy matches;
    • --records with no record repo.
      The mirrored-table test uses the new search_records result (lines, notes, copies).
  • install.test.py: a program running from an unrelated /usr/local/bin/facts does not block uninstall, and a program running from our own link does.

These pass locally:

  • fork-ci-tests for fork-kit/agent-guards/ (9 files) and fork-kit/common/;
  • the cleaner and golive kits, which use the shared installer.

The desk, schedule-kick and update-policy kits pass except for checks tied to this host: a full disk, a group-writable temp folder, and a stray __pycache__ in a local checkout. None of these touches this change.

The seam check, the upstream-files check and fork-tests-drift (78 tests) also pass.

🤖 Generated with Claude Code

- a project name taken from a match ending in "." or ".." is dropped;
  a remote's ".git" is dropped
- a record folder that is a link out of the record repo is not searched
- the record search's time limit is checked for each folder, not only
  each file; files with a NUL byte are not text
- --records names the state-table copy when that is the only hit, and
  prints a note (exit 0) when no record repo is configured
- uninstall's running-code check ignores an OPTIONAL_LINKS path that
  belongs to another program

Refs #1063

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scuttletoby
scuttletoby merged commit 67924d0 into main Nov 23, 2026
30 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