core/scripts
Shay 4b51ba146d chore(dev): enforce fresh-base startup guard for CORE agents
Add scripts/agent_startup.sh — a sourced bash guard that prevents
stale-base worktrees from silently replaying or creating conflict PRs.

Root cause: PR #844 was opened from a worktree whose HEAD was behind
origin/main.  The resulting replay produced a conflict-laden PR that
required manual reconciliation (see PR #847).

## Behaviour

Default (new implementation task):
  HEAD must equal origin/main
  Working tree must be clean
  → source scripts/agent_startup.sh

PR-resume task:
  CODEX_ALLOW_NON_MAIN_BASE=1 source scripts/agent_startup.sh
  origin/main must be a strict ancestor of HEAD (enforced via merge-base)

Debug-only dirty override:
  CODEX_ALLOW_DIRTY=1 source scripts/agent_startup.sh

## Steps performed by the script

1. git fetch origin --prune
2. Print HEAD / branch / origin/main / merge-base
3. Fail if dirty (unless CODEX_ALLOW_DIRTY=1)
4. Fail if HEAD != origin/main (unless CODEX_ALLOW_NON_MAIN_BASE=1)
5. In resume mode, verify origin/main is ancestor of HEAD via merge-base
6. Print diff --name-status vs origin/main
7. Verify uv exists
8. uv sync --frozen only when uv.lock is present
9. Print final git status

## Escape hatches

CODEX_ALLOW_NON_MAIN_BASE=1   PR-resume, ancestry enforced
CODEX_ALLOW_DIRTY=1            Debug/WIP sessions, documented in session log

## Validation

bash -n scripts/agent_startup.sh  → OK
git diff --check                  → OK (no trailing whitespace)
shellcheck not available locally; shebang is bash, bash -n passed

## Non-goals

Does not touch runtime, evals, reports, teaching proposals, packs,
policy, identity, recall, vault, field, algebra, or serving paths.
2026-06-20 19:58:33 -07:00
..
__init__.py
agent_startup.sh chore(dev): enforce fresh-base startup guard for CORE agents 2026-06-20 19:58:33 -07:00
build_refusal_taxonomy_cases.py fix(refusal-taxonomy): parse new refusal-reason format; reconcile to reader gains 2026-06-03 01:49:41 -07:00
calibrate_ratification_threshold.py chore(ratifier): calibrate default ratification threshold 0.0 → 0.5 (#86) 2026-05-20 19:59:25 -07:00
dump-api-schemas.py feat(W-028): chat surface + trace drawer (#303) 2026-05-26 13:22:11 -07:00
dump-enums.py feat(workbench): CORE-Logos Studio LG-2 — /logos route shell + Overview/Identity/Safety 2026-06-14 12:12:47 -07:00
dump-schemas.py feat(workbench): design mastery pass — chain rail, typography, doctrine-as-tests (Wave R R1) 2026-06-12 13:18:44 -07:00
generate_claims.py feat: ratify independent-gold invariant (INV-25) + SHA-pin deductive lane 2026-06-04 15:56:28 -07:00
generate_discourse_paragraph.py feat(benchmarks): discourse_paragraph lane + pipeline profiler + word-selection tracer 2026-05-16 21:53:46 -07:00
generate_en_numerics_v1.py feat(packs): ADR-0128.1+0128.2 — en_numerics_v1 + loader 2026-05-23 07:02:09 -07:00
generate_english_fluency_ood.py fix(gaps): close G1+G2+G3 + identity vocab + pipeline safety-stub honour 2026-05-16 21:21:06 -07:00
generate_grammatical_v2.py
generate_identity_curriculum.py
generate_identity_test_cases.py
generate_monotonic_cases.py
generate_phase5_domain_lanes.py
generate_phase5_language_lanes.py
gsm8k_experience_flywheel.py feat(gsm8k): add bounded experience flywheel for sealed practice 2026-06-17 21:05:02 -07:00
gsm8k_frontier_report.py feat(derivation): Workstream A inc 2 — frontier report + rate_with_currency apply_rate injection (#797) 2026-06-17 06:38:45 -07:00
gsm8k_microscope.py fix(adr-0191): candidate-graph completeness guard — real-corpus wrong 5→0 (#496) 2026-05-30 15:45:07 -07:00
gsm8k_post_gate_a1_frontier_microscope.py feat(derivation): Gate A2a unit partition injection (#809) 2026-06-17 18:14:24 -07:00
gsm8k_problem_frame_adequacy.py feat(kernel): implement ProblemFrame proportional-change closure (PR slice 1) (#835) 2026-06-20 10:58:43 -07:00
gsm8k_sealed_attempt_scout.py feat(evals): add GSM8K sealed attempt scout (#812) 2026-06-17 19:55:13 -07:00
gsm8k_substrate_morphology.py feat(kernel): implement ProblemFrame proportional-change closure (PR slice 1) (#835) 2026-06-20 10:58:43 -07:00
publish_pack_measurements.py chore(evals): contracts + bench json + Lane B viewer + chart + audit + demo schema (#62) 2026-05-20 13:53:13 -07:00
ratify_anchor_lens_packs.py chore(packs): re-seal register packs (ISSUED_AT bump + missing seals) 2026-05-20 07:39:38 -07:00
ratify_ethics_pack.py feat(packs): expansion round 2 — ethics ×3, anchor-lens ×3, relations-v3, register ×2 (#48) 2026-05-20 07:18:35 -07:00
ratify_identity_packs.py feat(identity-packs): ADR-0027 Phase 5 — ratify all three v1 packs 2026-05-17 19:31:55 -07:00
ratify_register_packs.py fix(packs/register): remove bare '.' closings + ratify gate refuses them 2026-05-21 06:57:43 -07:00
ratify_rhetorical_style_packs.py feat(adr-0087): rhetorical-style pack substrate (loader + default_unstyled_v1) (#74) 2026-05-20 16:19:36 -07:00
ratify_safety_pack.py feat(safety): ADR-0029 — always-loaded, never-replaceable safety pack 2026-05-17 19:56:29 -07:00
review_trace.py
run_examples.py
run_pulse.py
scaffold_phase5_domain_lanes.py
score_phase5_holdouts.py
seal_gsm8k_test.py feat: ADR-0119.7 — seal GSM8K test as gsm8k_math holdout (Phase 5 substrate complete) 2026-05-22 20:08:35 -07:00
seal_holdouts.py feat(evals): ADR-0105 — sealed holdout encryption via age (#108) 2026-05-22 10:09:43 -07:00
verify_definitional_closure.py feat(packs): ADR-0085 content style pass v2 — 3sg + plural agreement (+ closure infra) (#100) 2026-05-20 23:12:28 -07:00
verify_lane_shas.py fix(ci): re-pin public_demo lane SHA after showcase content drift (#807) 2026-06-17 15:42:40 -07:00
verify_semantic_equivalence.py test(derivation): add ADR-0184 semantic replay equivalence harness 2026-06-10 14:35:22 -07:00
workbench feat(workbench): one-command launcher with fail-loud preflight + README quick-start 2026-06-13 00:06:31 -07:00