Unify examples, templates, and add verbatim golden comparison#35
Conversation
- Rename fixtures/ -> sources/ in examples 01 and 02 - Update all path references (pipeline.py, fix_source.py, tape.tape) - Simplify core layer config (remove Opus, add upgrade comment) - Update topical pipeline with technical topic list - Add .env.example to all 3 examples - Rewrite README for example 01, create README for example 03 - Create case.py for example 01 (plan/build/search/rebuild demo) - Generate anonymized ChatGPT/Claude export data for example 01 - Record cassettes for example 01 (pipeline_monthly.py) - Delete old src/synix/templates/init/ - Create scripts/sync-templates (copies user-facing files from examples) - Create scripts/new-example (scaffolds new example structure) - Rewrite init_commands.py with --template and --list options - Rewrite scripts/prerelease with sync-templates + example verification - Add demo-smoke CI matrix for all 3 examples - Create tests/unit/test_templates.py (template-example sync tests) - Add --template/--list assertions to test_init_cli.py - Sync templates from examples (769 tests passing)
Catch UX regressions (formatting, wording, panel layout) by comparing normalized stdout/stderr for every demo step against golden files. - Pin COLUMNS=120 and NO_COLOR=1 in subprocess env for consistent output - _normalize_output() replaces timing, LLM stats, paths, API key lines, and verify counts with stable placeholders - _show_text_diff() displays unified diff capped at 15 lines - --update-goldens writes text goldens alongside existing JSON goldens - Missing golden = warning, not failure (first-run safe) - Sort lineage tree parent IDs for deterministic output - Add uv run release and uv run verify-demos entry points - Update CLAUDE.md contributing section
Add normalization for built/cached/new/rebuild status words and materialization state so goldens match on both fresh CI builds and incremental local runs.
- Normalize standalone "cached" status word - Normalize plan "Estimated:" summary line - Normalize Build Summary table cell numbers - Fix release() ordering: format before sync-templates
- Combined pattern for cached/new/materialized + indexed count - Standalone "cached" now normalizes to <MATERIALIZED> (matches materialized) - Added <N> indexed normalization for search projection plan lines - Added test for search projection status normalization - Regenerated all goldens with unified placeholders
- Add cassette miss key hash normalization (<HASH> placeholder) - Normalize standalone 'built' same as 'cached' → <MATERIALIZED> - Add tests for both new normalization patterns - Regenerate all goldens
Collapsed whitespace around <MATERIALIZED> in table cells so 'cached' (6 chars) and 'built' (5 chars) produce identical output.
Goldens were previously generated from cached local state. CI starts from a clean checkout, producing different output (fresh LLM calls via cassette replay, different artifact counts, validator results). Delete build dirs before regenerating to match CI's fresh-build scenario. Also normalize whitespace around <MATERIALIZED> in table cells.
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| example: [examples/01-chatbot-export-synthesis, examples/02-tv-returns, examples/03-team-report] |
There was a problem hiding this comment.
Can we just have it enumerate the subdirs of examples so we don't have to keep updating?
|
|
||
| ## Sample Data | ||
|
|
||
| Place your ChatGPT and Claude exports into `sources/`: |
There was a problem hiding this comment.
Can you add the specific instructions or reference to the instructions for how to get these files from those platforms. Give a the full list of command they need to run once they get the extracts in their email and download.
| **ChatGPT:** Settings -> Data Controls -> Export data. Download the zip, extract `conversations.json`, and copy it into `sources/`. | ||
|
|
||
| **Claude:** Settings -> Export data. Download and copy the JSON file into `sources/`. |
There was a problem hiding this comment.
If there's deep link we can use do it. Give the commands for extract.
| synix search 'hiking' | ||
| ``` | ||
|
|
||
| ## Use Your Own Data |
There was a problem hiding this comment.
Suggest example for them to try....create their own bio profile and add themselves to the team...change the project..how ot make those changes to the pipline.
| synix build pipeline.py | ||
| synix validate pipeline.py | ||
| synix search 'hiking' |
There was a problem hiding this comment.
uvx for all synix command when used in a customer facing context rather than internal dev. Add to claude.md and fix everywhere.
| \`\`\` | ||
| README | ||
|
|
||
| echo "Created example at $dir" |
There was a problem hiding this comment.
Rename "example" as "template" we don' want to expose the cassette features as part of the external facing product spec..ONly for internal.
| @@ -0,0 +1,25 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Why do we need this step why can't we just have the single SoT?
| @@ -0,0 +1,11 @@ | |||
| # Synix uses the API key matching your pipeline's provider setting. | |||
There was a problem hiding this comment.
Can we just define this .env.example in a single place and the copy it when we create a project from a template..dont want to have to edit all these each time we change what we support.
| # --------------------------------------------------------------------------- | ||
|
|
||
| @register_transform("demo_load_product_offers") | ||
| class DemoLoadProductOffersTransform(BaseTransform): |
There was a problem hiding this comment.
Let's keep pipeline.py clean for all these examples and put any custom transform for the examples in their own distinct submodule that get's spun up with the project creation eg src/{my-project}/transforms etc.
- Dynamic CI matrix: discover examples/ subdirs at runtime - Use `uvx synix` in all customer-facing docs (READMEs, init output) - README 01: add ChatGPT/Claude export instructions with deep links - README 03: add try-it-yourself guide with concrete next steps - Rename scripts/new-example → new-template, remove dev-only scaffolding - Single .env.example SoT at templates root (remove per-template copies) - Separate custom transforms into transforms.py (example 02) - Add explanatory comment to sync-templates - Regenerate goldens and sync templates
Single naming convention: everything is "templates". The repo-root templates/ dir is the source of truth; src/synix/templates/ remains the curated subset bundled in the wheel (sync-templates copies user-facing files only). Updated: CI workflow, scripts, pyproject.toml, READMEs, pipeline comments, test paths, CLAUDE.md, .gitignore. Regenerated all goldens from clean state.
- Use `uvx synix` consistently in all customer-facing commands - Remove inaccurate max_length validator reference (it's a custom validator in the template, not built-in) - Fix "all commands default to pipeline.py" — only build/plan/ validate/fix/clean take a pipeline path
Summary
Overhauls the examples/templates system and adds verbatim stdout/stderr golden comparison to catch UX regressions.
Examples & Templates
fixtures/tosources/in examples 01 and 02, update all path referencescase.py, anonymized ChatGPT/Claude export data, recorded cassettes forpipeline_monthly.py.env.exampleadded to all 3 examplessrc/synix/templates/init/replaced by per-example templates synced fromexamples/scripts/sync-templatescopies user-facing files from examples to templatesscripts/new-examplescaffolds new example directory structuresynix init --template / --listrewritten to use per-example templatesscripts/prereleaserewritten with sync-templates + example verificationVerbatim Golden Comparison
_normalize_output()replaces dynamic values (timing, LLM stats, paths, API key lines, artifact counts) with stable placeholders_show_text_diff()shows unified diff capped at 15 lines, color-coded--update-goldenswrites text goldens (.stdout.txt/.stderr.txt) alongside existing JSON goldensCOLUMNS=120andNO_COLOR=1in subprocess env for consistent Rich output across machinesDev Workflow
uv run releasefull pre-push check suite: sync templates, ruff fix, ruff check, pytest, verify all demosuv run verify-demosstandalone demo verification for fast UX feedbackCodebase Formatting
ruff formatpass acrosssrc/andtests/Test plan