Skip to content

test: implement multi-tiered verification architecture and Makefile tooling#54

Merged
JacksonFergusonDev merged 10 commits intomainfrom
test/multi-tier-verification
Feb 25, 2026
Merged

test: implement multi-tiered verification architecture and Makefile tooling#54
JacksonFergusonDev merged 10 commits intomainfrom
test/multi-tier-verification

Conversation

@JacksonFergusonDev
Copy link
Owner

@JacksonFergusonDev JacksonFergusonDev commented Feb 25, 2026

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)

  • Built an ephemeral, fully local distributed simulation that bypasses the need for VMs during routine CI/CD.
  • Uses XDG_STATE_HOME environment variables to run multiple isolated daemon instances interacting with a local bare remote.
  • Implements strict bash trap signals to guarantee sandbox teardown and actively parses daemon logs to catch swallowed subprocess exceptions during shadow commits.

2. Tier 3: Field Operations (scripts/spawn_cluster.sh)

  • Automated the provisioning of Ubuntu VMs via Canonical's Multipass to test Linux service integrations (systemd, battery polling) locally from macOS.
  • True Isolation: Mounts the host's source code as read-only (/mnt/pulsar-source), bootstraps a Linux-native uv environment, and drops the user into a disposable ~/playground repository. Ensures zero risk of destructive commands affecting the host macOS repository.

3. Unified Tooling (Makefile)

  • Introduced a Makefile to act as the central switchboard for developer workflows.
  • Added color-coded execution stages for make format, make lint, make typecheck, and explicit targets for each testing tier (test-unit, test-dist, test-cluster).
  • Added a make ci target to run the exact GitHub Actions pipeline locally.
  • Gracefully handles cross-ecosystem dependencies (e.g., falling back to npx for markdownlint if the native binary is missing).

4. CI/CD & Observability

  • Integrated the Tier 2 distributed sandbox into .github/workflows/ci.yml. Distributed syncing logic is now automatically validated on both macos-latest and ubuntu-latest on every push.
  • Added logger.debug injection in git_wrapper.py to output exact subprocess execution strings, heavily streamlining the debugging of failed shadow commits in CI environments.
  • Completely rewrote tests/README.md and updated the primary README.md to surface this testing philosophy to users and contributors.

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.
@JacksonFergusonDev JacksonFergusonDev force-pushed the test/multi-tier-verification branch from 1cb3eb5 to 98cea79 Compare February 25, 2026 02:26
@JacksonFergusonDev JacksonFergusonDev merged commit cd95d9b into main Feb 25, 2026
4 checks passed
@JacksonFergusonDev JacksonFergusonDev deleted the test/multi-tier-verification branch February 25, 2026 02:28
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