Commit Graph
25 Commits
Author SHA1 Message Date
jpmschweitzerandClaude Opus 4.8 b24a3596b5 fix(config): post-checkout does nothing on same-HEAD instead of export --stage
Refines 34ffcda86. The export --stage approach preserved the mutation but did more
than the bug needs: it eagerly stages changelog rows mid-checkout (surprising in
git status), and those staged rows can leak onto the wrong branch when a later
switch rebuilds by replaying the working-tree changelog.

Minimal fix: on a branch *creation* / no-op checkout (prev-HEAD == new-HEAD) the
working tree is unchanged, so pql.db already holds the committed state plus any
uncommitted mutation — just skip the whole block (do nothing). The mutation stays
in pql.db untouched and the next commit's pre-commit hook flushes it normally. Only
a real branch *switch* (prev != new) rebuilds. No git-index side effects, no leak.

Verified: same-HEAD invocation preserves an uncommitted status mutation and stages
nothing. (Credit: pql-clide's review of the upstream feature request.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 12:42:08 +02:00
jpmschweitzerandClaude Opus 4.8 34ffcda86f fix(config): post-checkout preserves uncommitted pql mutations on branch creation
The post-checkout hook ran 'pql plan rebuild' (drop + replay changelog) on every
branch checkout, including 'git checkout -b'. That silently dropped any pql.db
ticket mutation not yet in the committed changelog — e.g. an in_progress status set
right before cutting a feature branch (hit this session: T-1039/T-1043 reverted to
backlog at branch creation).

Git has no pre-checkout/pre-worktree hook, so capture the changelog at post-checkout
instead: when prev-HEAD == new-HEAD (a branch *creation* — content unchanged, pql.db
already correct), run 'pql plan export --stage' (the same flush the pre-commit hook
does) instead of the destructive rebuild. Real branch *switches* (prev != new) still
rebuild to match the branch's changelog.

Verified: simulating a same-HEAD checkout with an uncommitted in_progress mutation now
preserves it (previously reverted).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 12:23:28 +02:00
jpmschweitzerandClaude Fable 5 3a3e7c72fe chore(config): blocking client-test gate in pre-push (T-1065); amend D-067 chime duration
pre-push now runs the full gdUnit4 suite via tests/run-godot when client/
changed — blocking, ~100s, suite made green by T-973 and independently
re-verified. The tooling gate (make test-tooling on TOOLING_CHANGED, T-1066)
rides in the same hook. D-067 amended: the shipped chime is a deliberate
800ms synthesis (#327, ui.md UI-005); prose said 300-400ms. Ticket closes
for the maintenance wave in the changelog.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 16:24:34 +02:00
jpmschweitzerandClaude Opus 4.8 c318cea6db chore(config): gate cargo test in pre-push on Rust changes
Add `cargo test --quiet` to the pre-push Rust block (sharing clippy's
target/ guard) so the suite runs automatically on every push touching
server/. Nothing ran the tests before — pre-push did only fmt/clippy/deny
and there is no CI — so a Rust regression could reach main unverified.

Document the resulting agent-spawn rule in team-patterns.md: don't have
implementation agents pre-run fmt/clippy/test pre-emptively, since the push
gate now enforces all three. The gate is authoritative; the lead patches any
fallout at push.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 10:39:55 +02:00
jpmschweitzerandClaude Opus 4.8 af9412b988 chore(config): wire pql hooks + Makefile decision targets (pql migration phase 4)
Folds pql's planning logic into the version-controlled .config/hooks/* (pql's own
.pql/hooks installer is dead under core.hooksPath=.config/hooks):

  - pre-commit: + `pql decisions validate` (decision-ID/format gate, supersedes the
    never-built check-decision-ids TODO) and `pql plan export --stage` (flush ticket
    mutations to the git-tracked changelog and stage them into the commit). Both
    guarded by `command -v pql`; export is a clean no-op when nothing changed.
  - post-merge: `pql plan import` + `pql decisions sync` (replay incoming changelog,
    re-sync markdown decisions).
  - post-checkout (branch only): `pql plan rebuild` + `decisions sync`.
  - post-rewrite (rebase/amend): `pql plan rebuild`.
  - install-hooks chmods the three new hooks.

Makefile decision targets repointed to pql: decisions-sync -> `pql decisions sync`,
decisions-active -> `pql decisions list --type confirmed`, new decisions-validate ->
`pql decisions validate`. Dropped the SQLite-query conveniences (coverage/orphan/
orphan-tickets); per-decision coverage is `pql decisions show <id> --with-tickets`.

db-backup/db-install and SR_DB_PATH are intentionally kept until Phase 6 so the
legacy SQLite store stays intact as the migration rollback path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 12:49:42 +02:00
jpmschweitzerandClaude Opus 4.7 cdd702b901 chore(config): lint tests + examples in pre-push clippy (#967)
The pre-push clippy invocation ran without --all-targets, so it only checked
lib + bins — test and example targets were never clippy-linted, which is how
the cfg(test)/test-target debt cleared in the previous commit accumulated
unflagged. Add --all-targets now that the debt is clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 11:03:23 +02:00
jpmschweitzerandClaude Opus 4.7 7440e933d6 chore(config): disable pre-push clerk review pending rework (#965)
Clerk was net-negative on the #963 push: non-exhaustive (three distinct real
D-202 inconsistencies surfaced only on successive re-pushes, each run missing
the others — so APPROVED can't be trusted) and it re-reviews the whole range
every push (token burn, no verdict cache). Gate it behind SR_RUN_CLERK=1
(default off). Rework tracked in #965; decision-record consistency is the
author's responsibility until then.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 09:49:15 +02:00
jpmschweitzerandClaude Opus 4.7 bf3659d1a5 fix(meta): clerk-review — incomplete reviews no longer false-reject
The per-commit clerk had three flaws, exposed by a 20-commit push where 6 of 7
rejections were false (incl. a CHANGELOG-only commit):

1. No-verdict / max-turns / timeout defaulted to REJECTED — an unfinished review
   read as 'hard contradiction found'. Now a third outcome, INCOMPLETE, which is
   non-blocking (the push proceeds with a warning); only a real REJECTED blocks.
2. Turn/time budget too tight (6 turns / 150s) for decision-heavy commits. Raised
   defaults to 15 turns / 300s, and the prompt now biases to APPROVED when no
   concrete contradiction is found ('unsure' means APPROVED, never REJECTED).
3. The skip valve matched its own feature commit because it scanned for the token
   anywhere in the message. Moved to a trailer-line match so prose/subject mentions
   no longer trip it.

Pre-push hook updated to treat INCOMPLETE as a non-blocking warning. The git-commit
skill documents the trailer form.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 16:59:44 +02:00
jpmschweitzerandClaude Opus 4.6 e6a557e8e7 feat(meta): replace sprint workflow with kanban + milestones (D-221)
Sprint-based workflow (38 sprints) replaced by kanban + milestones.
Milestones are many-to-many with tickets and can block each other.

New: /whats-next skill (dependency-driven batch selection with Si
refinement review), /pr-process skill (renamed from pr-push, adds
review comment pickup), clerk agent + pre-push hook for D-record
consistency checks.

Deleted: sprint CLI, sprint-start/sprint-plan/sprint-status skills,
team-scoped file restrictions. Si rewritten as refinement manager.
All 19 agent briefings updated from stale PROJECT_STATE.md reference
to live ticket milestone queries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 20:11:00 +02:00
jpmschweitzer fcd434e528 Merge remote-tracking branch 'origin/sprint-37/copy'
Resolved 8 conflicts in wiki/corporations/ between server #860 tag
updates and copy #861 three-layer authoring. Resolution: union of
server's commodity-tag additions + D-175 decision_refs, plus copy's
cross_refs populated entries.
2026-04-22 11:25:55 +02:00
jpmschweitzerandClaude Opus 4.7 055a019277 chore(config): pre-push — fall back to origin/main on first push
When a new branch is pushed for the first time, origin/<branch> does
not yet exist, so the pre-push hook was falling through to treating
every directory as changed. On a wiki-only branch this meant running
Godot headless parse, cargo fmt + clippy, ruff, and validating all
2762 repo-wide JSON files — tens of seconds of churn against a diff
that had no client/server/tooling/JSON content.

Fix: try origin/<branch> first, fall back to origin/main before
giving up. The JSON validation block now uses the same REMOTE_REF
the directory-change detection settled on, so both code paths stay
consistent.

Scope note: this is CI/tooling infrastructure, not copy-team scope,
but surfaced as part of reviewing the slow push on sprint-37/copy.
Bundling here rather than a separate branch at Jeroen's direction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 10:32:51 +02:00
jpmschweitzerandClaude Opus 4.6 3d9dd7d909 chore(ci): merge brand pipeline into import_economics + harden review findings
Addresses all blocking + minor items from PR #136 review.

Architectural change (T2/H3 — the review's main complaint):

  generate_brands was previously a separate Rust binary that produced a TOML
  artifact, with its stamp written "on behalf" by import_economics.py at the
  end of its own run.  Reviewers flagged the invisible coupling: two sources
  of truth in a system designed to have one, and no way to tell from the
  stamp that one "generator" was really a subroutine of the other.

  import_economics now invokes tooling/generate-brands as the first step of
  its main() flow, before opening its own DB connection.  The TOML artefact
  is still produced and still committed (useful for diff-review of brand
  changes), but there's now one pipeline owner.  The meta table carries two
  rows (import_economics, generate_atlas) not three; the Rust binary's
  source SHA folds into import_economics' stamp via IMPORT_ECONOMICS_SOURCES.
  A MIGRATION_SQL DELETE cleans up pre-merge DBs that still have the
  orphan generate_brands row.

Other review items addressed in-line:

  H1  generate_atlas._write_stamp no longer commits — transaction ownership
      stays with the caller (matches import_economics pattern).  Stamp +
      atlas data now commit atomically; a failed stamp rolls back the
      atlas data rather than leaving a stamp-missing-data intermediate.

  H2  _file_sha1 (in both import_economics, generate_atlas,
      check-systems-db-stamp) raises FileNotFoundError on missing sources
      instead of silently contributing an empty-bytes hash.  A ghost-SHA
      convergence could otherwise produce vacuous "fresh" passes.

  H4  pre-push no-meta-table warning rephrased — was "run after next
      regeneration", now "run now if this DB was generated by you".

  T1  asset-pipeline.md determinism claim softened: the stamp is
      deterministic (same source → same recorded SHA), the DB binary is
      not (generated_at + SQLite rowids/freelist churn).

  T3  asset-pipeline.md gains a "migration escape hatch" section naming
      MIGRATION_SQL in import_economics.py as the only sanctioned path
      for direct writes, and forbidding hand-run sqlite-exec / one-off
      patch scripts / SQLite-GUI edits.

  T4  Makefile regen-db now runs as a single shell with `set -e`.  A
      failure in one generator halts the pipeline immediately, preventing
      the "stale data, fresh stamp" state where a later step stamped a
      DB whose earlier step had failed.  import_economics' exit code 2
      (coverage gate warning) remains explicitly tolerated.

  T5  pre-push stamp check now runs on a branch's first push too —
      compares against origin/main instead of origin/$BRANCH, closing
      the gap where a new branch could ship a stale DB via the first push.

  T6  check-systems-db-stamp fails closed on unknown generator_names in
      meta — a future branch adding a new generator without registering
      it in GENERATOR_SOURCES will now be rejected, not silently skipped.

  T7  /pr-push watch list gains a mutual cross-reference comment with
      GENERATOR_SOURCES in check-systems-db-stamp, plus the missing
      names.rs source file, so the two lists cannot silently drift.

Follow-up tickets created:

  #887 T8  decisions-orphan-tickets CLI — surfaces tickets whose
           decision_ref points at a non-existent D-record.
  #888 T9  meta.schema_version monotonic semver — for savegame migration
           lineage in Phase 5+ (SHA comparison can't be ordered).

Verified:

  make regen-db end-to-end — OK
  make check-systems-db    — OK, 2 generator(s) up to date
  STALE detection          — OK, verified by touching generate_atlas.py
  /pr-push watch list      — OK, flags this branch's changed sources
  decision show D-159      — OK, structured output with tickets + refs

Refs: #855 #856 #857 #858 #859 PR #136

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-22 08:38:41 +02:00
jpmschweitzerandClaude Opus 4.6 8371e05e52 chore(ci): generator-driven asset pipeline — meta stamp + hook + regen target
Adds systems.db regeneration discipline (#855) via a `meta` table (#856)
stamped by every generator, a pre-push hook that rejects stale DBs (#857),
and the top-level `make regen-db` / `make check-systems-db` targets that
drive the whole pipeline.

The stamp stores SHA-1 of generator source + schema, so the pre-push hook
can cheaply detect "you changed a generator but forgot to regen the DB"
before a binary merge conflict lands. Sprint 36 hit that class of conflict
on two branches touching systems.db simultaneously — this is the systemic
fix.

Regenerated systems.db is stamped; `make check-systems-db` passes.

Refs: #855 #856 #857

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 17:34:52 +02:00
jpmschweitzerandClaude Opus 4.6 db3daecfaf chore(config): add JSON syntax validation to pre-push hook
Validates changed JSON files using python3 -m json.tool (zero
dependencies). Same diff-based scoping as existing checks — only
files changed vs remote are validated. Blocks push on syntax errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 16:00:29 +02:00
jpmschweitzerandClaude Opus 4.6 74d6aee0c1 chore(ci): add ruff to pre-push hook and Makefile
Add Python/ruff block to .config/hooks/pre-push (runs on tooling/
changes). Add lint-python and setup-venv Makefile targets, wire
both into make lint and make setup respectively.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 09:40:10 +02:00
jpmschweitzerandClaude Opus 4.6 73c81c1217 chore(tooling): consolidate atlas tooling + harden pre-push hook
- Rewrite atlas-verify as proper Python script (was inline Python in
  bash with path injection risk). Adds star_type/spectral_class
  consistency check. Supports multiple files via glob.
- Add atlas-names and atlas-systems-done query helpers (clean versions
  of what the copy branch created — supersedes atlas-helpers.sh)
- Wire atlas-verify into Makefile (make atlas-verify, pre-pr-content)
- Update atlas skill references to point to the script
- Merge diff-based skip into pre-push hook: only lint client/ or
  server/ when those dirs actually changed in the push. Combined with
  existing directory-existence guards for cold worktrees.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 08:06:44 +01:00
jpmschweitzerandClaude Opus 4.6 604467045c fix(config): make pre-push hook tolerant of cold worktrees
Skip checks gracefully when .godot/, client/scripts/, or server/target/
don't exist instead of failing. Worktree branches can now push without
needing a full Godot import or Rust build first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:58:31 +01:00
jpmschweitzerandClaude Opus 4.6 4d1a29bcc1 chore(config): add gdlint + gdformat + cargo-deny to pre-push hook
Pre-push now runs 6 checks:
- GDScript: parse check, gdlint (static analysis), gdformat (style)
- Rust: clippy, fmt, cargo deny (license/advisory/deps)
All tools degrade gracefully if not installed.

Also files Q-065 through Q-080: shooting mechanics, procedural terrain,
cloth sim, vehicle physics, PathMesh3D, NobodyWho vs voice pipeline,
BitTorrent distribution, BehaviourToolkit patterns, screenshot manager,
RichText3D, DeformableMesh, GridMapLayer, mod loader, god rays,
Steam multiplayer, CityCrafter3D, planet generator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 19:06:03 +01:00
jpmschweitzerandClaude Opus 4.6 c87dbbf4b6 chore(config): add pre-push hook for GDScript and Rust linting
Runs GDScript parse check (headless Godot) and Rust lint (clippy +
fmt --check) before every push. Catches type inference errors and
formatting issues that code reviews missed in sprint 28.

Uses the existing .config/hooks/ infrastructure (core.hooksPath).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 18:23:56 +01:00
jpmschweitzerandClaude Opus 4.6 034c1c6e37 fix(simulation): apply PR #94 review suggestions
- validate_ron: add eligible_roles referential integrity check against
  defined RoleSpec.id values in zone-type templates
- v01-yaml-content-audit.md: fix grep path from data/templates to
  server/data/templates in the superseded-files verification command
- pre-commit hook: comment out nonexistent check-decision-ids script
  to stop per-commit warnings until the script is implemented

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 12:25:07 +01:00
jpmschweitzerandClaude Opus 4.6 18afede4f2 feat(simulation): add cargo audit to CI/review pipeline (#637)
Add `make audit` target running `cargo audit` with an advisory ignore for
RUSTSEC-2025-0141 (bincode, tracked by #636). Wire audit into `make pre-pr`
and `make pre-pr-server`. Add conditional cargo audit to the pre-commit hook
(triggers only when Cargo.toml/Cargo.lock are staged).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:40:15 +01:00
jpmschweitzerandClaude Opus 4.6 0cf4dcc3f9 feat(db): decision ID claim system — prevent cross-worktree collisions
- `db/connectors/decision next [D|Q|R]` — show next available ID
- `db/connectors/decision claim <prefix> <domain> [title]` — reserve ID in DB
- `db/connectors/decision check-dupes` — detect duplicate IDs in markdown
- `tooling/check-decision-ids` — pre-commit hook for dupe detection
- D-035 added as known exception (139 files, too embedded to renumber)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 10:51:46 +01:00
jpmschweitzerandClaude Opus 4.6 163de8bf25 fix(ci): address PR review — filter comments, trim whitespace, warn on missing scripts
- Filter YAML comment lines (grep -v '^\s*#') from both extraction
  pipelines to prevent phantom canonical IDs
- Trim trailing whitespace from extracted fact_ids so grep -qxF exact
  match works reliably
- Pre-commit dispatcher now prints explicit warning when a check script
  is missing instead of silently skipping
- Document --no-verify bypass for emergencies in DEVOPS.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:42:22 +01:00
jpmschweitzerandClaude Opus 4.6 fe204aa5f4 feat(ci): add pre-commit FactId validation hook (#393)
Grep-based pre-commit check validating fact_id references in content
YAML against canonical knowledge catalogs. Runs in advisory mode when
catalogs are stubs (exit 0), switches to enforcing mode once populated
(exit 1 on unknown fact_ids with file:line output).

- tooling/check-fact-ids: core validation script (<2s runtime)
- .config/hooks/pre-commit: hook dispatcher for modular checks
- Makefile: check-fact-ids + setup-hooks targets, wired into setup
- docs/DEVOPS.md: content validation and pre-commit hooks sections

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:17:34 +01:00
jpmschweitzerandClaude Opus 4.6 38ded93a5b chore(meta): add project directory scaffold
Create client/, server/, tooling/, tests/, .config/ (tracked) and
.cache/ (gitignored). Update CLAUDE.md project structure to reflect
the new layout including workshops directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 01:21:11 +01:00