Move runnable scripts from repo root into examples/#130
Conversation
Moves the demo/PoC scripts out of the repo root into a conventional examples/ directory: anomaly_poc.py -> examples/anomaly_detection.py simulation_run.py -> examples/simulation.py twin_paradox.py -> examples/twin_paradox.py sanity_harness.py -> examples/sanity_harness.py calibration_harness.py -> examples/calibration_harness.py tests/conftest.py now adds examples/ to sys.path so test modules can still import them directly. tests/test_anomaly_poc.py is renamed to tests/test_anomaly_detection.py to match. Updated: README example-run commands, scripts/check_to_packet_contract.py target paths, tests/test_packet_contract_check.py expected target names, tests/test_harness_regressions_v020.py filesystem lookup. Repo root now holds only config (tg.yaml, pyproject.toml), docs, and the temporal_gradient package — no runnable scripts. 166 tests still passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 839d6b632f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| python examples/anomaly_detection.py # deterministic anomaly-stream PoC | ||
| python examples/simulation.py # end-to-end simulation |
There was a problem hiding this comment.
Fix example entrypoints after moving scripts into examples/
The new README commands run python examples/..., but those scripts now execute with sys.path[0] set to examples/, so imports like import temporal_gradient fail on a clean checkout (ModuleNotFoundError: No module named 'temporal_gradient'). This is a regression from the root-level scripts, and it makes the primary documented examples unusable unless users manually set PYTHONPATH or install the package first.
Useful? React with 👍 / 👎.
After moving entrypoints into examples/ (PR #130), running \`python examples/anomaly_detection.py\` failed with ModuleNotFoundError on a fresh clone because sys.path[0] was set to examples/, not the repo root. The package is only importable after \`pip install -e .\`. Add a 3-line sys.path bootstrap to each example to prepend the repo root, matching the pre-move behavior. Consistent with the existing bootstrap in examples/embedding_novelty_replay_demo.py. Addresses Codex review on PR #130. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary Cuts v0.3.0. Three things: 1. **License → MIT.** The prior bespoke "source-available, no execute" clause actively discouraged engagement with a public-portfolio repo. Replaced with standard MIT. 2. **Version bump 0.2.0 → 0.3.0** in \`pyproject.toml\`, \`temporal_gradient/__init__.py\`, and the version-check test. The merged cleanup PRs (#128, #129, #130) were breaking on the API surface (removed \`salience_mode\` kwargs, \`validate_packet\` alias, moved entrypoints), so this is 0.x-minor-bump territory. 3. **CHANGELOG rewrite.** The Unreleased block was stale — referenced \`docs/CANONICAL_VS_LEGACY.md\` and \`docs/archive/\` (both deleted) and documented a \`chronolog\` typo alias that's also gone. Replaced with a dated v0.3.0 section covering the full cleanup pass, plus a migration checklist for the breaking changes. Also applied **out of band** (repo settings, not a file change): - **Squash-merge set as the only allowed merge method** on \`WhatsYourWhy/The-Temporal-Gradient\` (merge commits + rebase disabled). - **Squash commit title** defaults to PR title; **squash commit message** defaults to PR body. Auto-merge and delete-branch-on-merge enabled. - Net effect: every future PR — including \`claude/...\`, \`codex/...\`, and \`alert-autofix-*\` bot branches — lands as a single clean commit named after the PR title. \`git log --oneline\` will tell an engineering story going forward. Historical bot merges on \`main\` are left as-is (rewriting merged history isn't worth it). Supersedes #131. ## Test plan - [x] \`pytest -q\` → 166 passed locally - [x] CI green on 3.10 / 3.11 / 3.12 - [x] After merge: tag \`v0.3.0\` and create a GitHub release pointing at the new CHANGELOG section Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Last structural item from the audit on #128. Moves the five runnable
entrypoints out of the repo root into a conventional `examples/`
directory:
Repo root now holds only config (`tg.yaml`, `pyproject.toml`), docs,
and the `temporal_gradient` package — no runnable scripts.
166 tests still passing.
Plumbing
importing the harnesses directly.
to match the new module name.
Test plan