Skip to content

chore: repository hygiene — .gitignore, artifact untracking, checksum automation#2

Merged
miter37 merged 1 commit into
masterfrom
chore/repo-hygiene
Jul 23, 2026
Merged

chore: repository hygiene — .gitignore, artifact untracking, checksum automation#2
miter37 merged 1 commit into
masterfrom
chore/repo-hygiene

Conversation

@miter37

@miter37 miter37 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Repository hygiene pass from the audit in docs/Relay-agent_repo_audit.md (P0 items 1.1–1.4). No runtime logic changed.

What changed

Item Before After
.gitignore did not exist added
.pyc files 47 tracked (cpython-312 and -314) untracked, kept on disk
relay.pyz, SHA256SUMS.txt committed to master untracked — release assets only
MANIFEST.txt committed deleted (nothing generates or reads it)
SHA256SUMS.txt generation by hand generated by build_release.py
Clone URL in CONTRIBUTING miter37/Relay (404) miter37/Relay-agent
Version literal duplicated in pyproject.toml read from relay.__version__

Why the checksum change matters

SHA256SUMS.txt was maintained by hand and had already gone stale — its README.md and RELEASE_NOTES.md entries did not match the working tree after the add-agent commit. The committed relay.pyz was also two commits behind and did not contain the add-agent command at all, while its checksum still validated cleanly. A hand-maintained checksum that certifies a stale artifact is worse than no checksum.

build_release.py now emits both files together, so they cannot drift apart.

Verification

  • python build_release.py → rebuilt artifact hash f8e1e054… matches SHA256SUMS.txt
  • python relay.pyz version → runs; add-agent present in --help
  • .gitignore confirmed working: reran the suite, regenerated .pyc files produce zero git changes
  • git ls-files → no __pycache__, .pyc, relay.pyz, SHA256SUMS.txt, or MANIFEST.txt

Test status — please read

python -m unittest discover -s tests60 run, 9 errors.

These 9 failures are pre-existing and unrelated to this PR. They were reproduced identically on unmodified master (33a9be6) in a throwaway worktree — same 9 test names, same WinError 193 on the extensionless mock CLIs under Windows. This is the cross-platform gap already documented in docs/KNOWN_LIMITATIONS.md, and is exactly what the CI workflow (next PR) is meant to surface.

Not included

History rewriting. Past .pyc commits remain in the log; removing them would rewrite every commit hash for no meaningful size benefit.

Repository hygiene pass. No runtime logic changed.

- .gitignore: new. Covers Python caches, virtualenvs, build output,
  test/coverage output, editor/OS files, and Relay build artifacts.
- Untrack 47 .pyc files (cpython-312 and -314 were both committed) plus
  relay.pyz, SHA256SUMS.txt, and MANIFEST.txt. Files stay on disk.
- build_release.py: now writes SHA256SUMS.txt alongside relay.pyz, so the
  checksum can no longer drift from the artifact. Previously SHA256SUMS.txt
  was maintained by hand and had already gone stale (its README.md and
  RELEASE_NOTES.md entries did not match the working tree).
- Delete MANIFEST.txt: nothing in the repository generates or reads it.
- CONTRIBUTING.md: fix clone URL (miter37/Relay -> miter37/Relay-agent);
  switch to `unittest discover` so add-agent tests are included; document
  the optional build step.
- pyproject.toml: version is now read from relay.__version__ instead of
  being duplicated as a literal.

Tests: 60 run, 9 pre-existing Windows failures (WinError 193 on the
extensionless mock CLIs). Verified identical on unmodified master via a
throwaway worktree, so this commit changes nothing about them. This is the
cross-platform gap already recorded in docs/KNOWN_LIMITATIONS.md.
@miter37
miter37 merged commit 47fc0b2 into master Jul 23, 2026
@miter37
miter37 deleted the chore/repo-hygiene branch July 23, 2026 07:41
miter37 added a commit that referenced this pull request Jul 23, 2026
…one (#11)

relay.pyz stopped being tracked in #2, but the documented install flow was
still "git clone && run the installer" -- and the installers hard-failed when
the file was absent. Since no release has been published yet, the fallback
they suggested ("use the packaged release") did not exist either, so a fresh
clone could not be installed at all.

Both installers now build the artifact themselves when it is missing and a
build_release.py is present, and only fail if it is still absent afterwards.
The Python version check moved above the build, since the build needs it.
README documents both paths: build from source (default) or download the
release asset.
miter37 added a commit that referenced this pull request Jul 23, 2026
Pushing a tag matching v* now builds and publishes the release. Nothing is
built or uploaded by hand.

The workflow refuses to publish unless everything agrees:

- the tag must match relay.__version__ (single source of truth since #2)
- RELEASE_NOTES.md must name the version being released
- the full test suite must pass
- the built relay.pyz must actually execute

All four run before the release is created, so a mislabelled or broken
release cannot reach users. build_release.py emits relay.pyz and
SHA256SUMS.txt in one run, so the checksum cannot drift from the artifact.

Also documents the procedure in CONTRIBUTING.md -- releases are infrequent
enough that an undocumented process is a forgotten one -- and records in the
self-update spec that release assets are the only source of truth for
relay.pyz and SHA256SUMS.txt, so `relay update` has no ambiguity about where
to fetch from.
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