test: implement multi-tiered verification architecture and Makefile tooling#54
Merged
JacksonFergusonDev merged 10 commits intomainfrom Feb 25, 2026
Merged
Conversation
Injects logger.debug prior to subprocess execution in the GitRepo wrapper. This provides full command reproduction context in the daemon logs to assist with debugging failed shadow commits and index operations.
- scripts/test_distributed.sh: Uses XDG_STATE_HOME to simulate a distributed multi-node environment locally. Includes strict trap cleanup and log-parsing to catch swallowed errors. - scripts/spawn_cluster.sh: Automates provisioning of a Multipass Ubuntu VM, mounting the live workspace, and bootstrapping 'uv' for OS-level Linux field testing.
- scripts/test_distributed.sh: Introduces Tier 2 testing. Simulates a multi-node environment locally using XDG_STATE_HOME isolation. Includes log-parsing to catch swallowed exceptions during shadow commits. - scripts/spawn_cluster.sh: Introduces Tier 3 testing. Automates Multipass VM provisioning for fully isolated Linux field testing. Mounts local source read-only and generates a safe `~/playground` repository.
Introduces a Makefile to act as the primary entry point for repository management. Standardizes formatting (make format), linting (make lint), and orchestrates the new Tier 1, 2, and 3 testing architectures into simple, color-coded CLI commands.
- Updates `make lint` to gracefully skip markdownlint with a warning if Node.js (`npx`) is not installed locally, preventing false-positive build failures. - Introduces `make ci` target to orchestrate the exact sequence of checks executed by GitHub Actions, enabling single-command local validation.
Updates developer setup and testing instructions to utilize the new Makefile targets. Clearly defines the scope and usage of Tier 1 (unit), Tier 2 (distributed sandbox), and Tier 3 (isolated Linux VM) testing procedures to prevent accidental data loss during local development.
Restructures the tests/README.md to document the new three-tiered verification strategy. Groups the existing Python test suite under Tier 1, and documents the newly introduced Tier 2 (distributed sandbox) and Tier 3 (Multipass VM) workflows. Updates the execution instructions to utilize the centralized Makefile commands.
Introduces a high-level overview of the three-tiered testing architecture (Unit/Fuzzing, Distributed Sandbox, and OS Field Testing). Designed to communicate the project's strict engineering constraints, focus on data integrity, and fault-tolerant design philosophy to technical reviewers and recruiters.
Replaces the generic pytest execution step with explicit calls to the new Makefile test targets. This wires the ephemeral distributed cluster (Tier 2) into the CI pipeline, ensuring sync operations, drift detection, and shadow commits are automatically validated against both macOS and Ubuntu runners on every push.
Resolves pipeline failures where the sandbox operated successfully on local host machines but failed in sterile runner environments. - Overrides Git identity via environment variables (GIT_AUTHOR_NAME) to satisfy isolated commit requirements without mutating the global ~/.gitconfig of local developers. - Constructs an absolute path reference to the compiled `.venv` binary to prevent execution context loss when `uv` traverses into the isolated /tmp sandbox. - Explicitly flags the initial bare repository branch to suppress Git terminal hints.
1cb3eb5 to
98cea79
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR overhauls the testing and verification infrastructure for Git Pulsar. Because the daemon operates asynchronously on the user's active working directory, standard unit testing is insufficient to guarantee data integrity. This introduces a strict, three-tiered testing architecture that safely validates distributed mechanics and OS-level integrations without risking host contamination.
Architectural Additions
1. Tier 2: Distributed Sandbox (
scripts/test_distributed.sh)XDG_STATE_HOMEenvironment variables to run multiple isolated daemon instances interacting with a local bare remote.trapsignals to guarantee sandbox teardown and actively parses daemon logs to catch swallowedsubprocessexceptions during shadow commits.2. Tier 3: Field Operations (
scripts/spawn_cluster.sh)systemd, battery polling) locally from macOS./mnt/pulsar-source), bootstraps a Linux-nativeuvenvironment, and drops the user into a disposable~/playgroundrepository. Ensures zero risk of destructive commands affecting the host macOS repository.3. Unified Tooling (
Makefile)Makefileto act as the central switchboard for developer workflows.make format,make lint,make typecheck, and explicit targets for each testing tier (test-unit,test-dist,test-cluster).make citarget to run the exact GitHub Actions pipeline locally.npxfor markdownlint if the native binary is missing).4. CI/CD & Observability
.github/workflows/ci.yml. Distributed syncing logic is now automatically validated on bothmacos-latestandubuntu-lateston every push.logger.debuginjection ingit_wrapper.pyto output exactsubprocessexecution strings, heavily streamlining the debugging of failed shadow commits in CI environments.tests/README.mdand updated the primaryREADME.mdto surface this testing philosophy to users and contributors.