lattice-cli 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {lattice_cli-0.1.1/src/lattice_cli.egg-info → lattice_cli-0.1.2}/PKG-INFO +1 -1
  2. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/pyproject.toml +1 -1
  3. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/__init__.py +1 -1
  4. lattice_cli-0.1.2/src/lattice/resources/claude/lattice-workflow/SKILL.md +135 -0
  5. lattice_cli-0.1.2/src/lattice/resources/codex/lattice-workflow/SKILL.md +135 -0
  6. lattice_cli-0.1.2/src/lattice/resources/generic/lattice-workflow/SKILL.md +143 -0
  7. {lattice_cli-0.1.1 → lattice_cli-0.1.2/src/lattice_cli.egg-info}/PKG-INFO +1 -1
  8. lattice_cli-0.1.1/src/lattice/resources/claude/lattice-workflow/SKILL.md +0 -115
  9. lattice_cli-0.1.1/src/lattice/resources/codex/lattice-workflow/SKILL.md +0 -124
  10. lattice_cli-0.1.1/src/lattice/resources/generic/lattice-workflow/SKILL.md +0 -130
  11. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/LICENSE +0 -0
  12. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/README.md +0 -0
  13. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/setup.cfg +0 -0
  14. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/__main__.py +0 -0
  15. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/agent.py +0 -0
  16. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/cli.py +0 -0
  17. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/constraints.py +0 -0
  18. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/formatters.py +0 -0
  19. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/ipog.py +0 -0
  20. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/model.py +0 -0
  21. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/parser.py +0 -0
  22. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/resources/claude/lattice-workflow/references/modeling-rules.md +0 -0
  23. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/resources/claude/lattice-workflow/references/worked-examples.md +0 -0
  24. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/resources/codex/lattice-workflow/agents/openai.yaml +0 -0
  25. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/resources/codex/lattice-workflow/references/modeling-rules.md +0 -0
  26. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/resources/codex/lattice-workflow/references/worked-examples.md +0 -0
  27. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/resources/generic/lattice-workflow/references/modeling-rules.md +0 -0
  28. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice/resources/generic/lattice-workflow/references/worked-examples.md +0 -0
  29. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice_cli.egg-info/SOURCES.txt +0 -0
  30. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice_cli.egg-info/dependency_links.txt +0 -0
  31. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice_cli.egg-info/entry_points.txt +0 -0
  32. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice_cli.egg-info/requires.txt +0 -0
  33. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/src/lattice_cli.egg-info/top_level.txt +0 -0
  34. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/tests/test_agent_bootstrap_matrix.py +0 -0
  35. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/tests/test_cli.py +0 -0
  36. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/tests/test_constraints.py +0 -0
  37. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/tests/test_examples.py +0 -0
  38. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/tests/test_ipog.py +0 -0
  39. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/tests/test_model.py +0 -0
  40. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/tests/test_parser.py +0 -0
  41. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/tests/test_schema_guidance_matrix.py +0 -0
  42. {lattice_cli-0.1.1 → lattice_cli-0.1.2}/tests/test_self_hosting_matrix.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lattice-cli
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Deterministic combinatorial coverage for agent workflows and constrained variant surfaces.
5
5
  Author-email: Tyler Klose <tylerklose@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lattice-cli"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "Deterministic combinatorial coverage for agent workflows and constrained variant surfaces."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "0.1.1"
5
+ __version__ = "0.1.2"
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: lattice-workflow
3
+ description: Use when planning or testing behavior or variant surfaces with interacting states, roles, permissions, feature flags, modes, providers, optional fields, component props, rendering branches, template variants, config matrices, lifecycle states, combinatorial edge cases, pairwise coverage, or t-way coverage. Extract a Lattice schema, run the local Lattice CLI, and use generated rows to strengthen plans, tests, fixtures, rendered variants, or review matrices.
4
+ ---
5
+
6
+ # Lattice Workflow
7
+
8
+ Use this skill to keep Claude on extraction and interpretation while Lattice handles the combinatorics.
9
+
10
+ ## When To Use It
11
+
12
+ - derive a combinatorial model from a feature or PRD
13
+ - derive a test matrix from existing code
14
+ - derive a variant matrix from a component, partial, template, design-system story, or config surface
15
+ - convert edge cases into explicit parameter/value constraints
16
+ - generate pairwise or 3-way scenarios without hand-enumerating combinations
17
+ - render a compact visual review matrix instead of every possible variant
18
+ - review a plan involving roles, permissions, modes, providers, feature flags, optional fields, component props, rendering branches, template variants, config matrices, or lifecycle states
19
+ - find coverage gaps where bugs hide in interactions rather than single branches
20
+
21
+ ## When NOT To Use It
22
+
23
+ - **Small enumerable spaces.** Fewer than ~10 total combinations — enumerate by hand.
24
+ - **Independent dimensions.** No interactions can surface a bug; each parameter affects behavior independently.
25
+ - **Non-deterministic systems.** The same input row won't produce repeatable output (e.g., testing LLM responses).
26
+
27
+ ## Minimal Example
28
+
29
+ A schema (YAML on stdin):
30
+
31
+ ```yaml
32
+ model_name: checkout
33
+ parameters:
34
+ user: [signed_in, guest]
35
+ payment: [card, apple_pay, paypal]
36
+ cart: [empty, single, multi]
37
+ constraints:
38
+ - invalid_pair: {payment: apple_pay, cart: empty}
39
+ ```
40
+
41
+ One generated row (JSON):
42
+
43
+ ```json
44
+ {"user": "guest", "payment": "card", "cart": "multi"}
45
+ ```
46
+
47
+ The schema is the contract. The generated rows are the source of truth. The schema file is optional transport.
48
+
49
+ ## Preflight
50
+
51
+ ```bash
52
+ command -v lattice >/dev/null 2>&1 && lattice --help >/dev/null
53
+ ```
54
+
55
+ If it fails, install from PyPI:
56
+
57
+ ```bash
58
+ pipx install lattice-cli
59
+ ```
60
+
61
+ ## Workflow
62
+
63
+ 1. **Extract the schema.** Choose one coherent interaction surface — one feature, one workflow, one service behavior, one endpoint family, one component's variant space, one template family, or one config matrix. Parameters represent independent decisions or state partitions. Values are meaningful partitions, not every literal in the codebase.
64
+
65
+ 2. **Encode constraints.** Use the smallest constraint type that matches the rule (see [Constraint Selection](#constraint-selection) below). Encode true impossibilities — do not strip them and mark invalid rows downstream.
66
+
67
+ 3. **Validate.**
68
+
69
+ ```bash
70
+ cat schema.json | lattice validate
71
+ ```
72
+
73
+ 4. **Generate.** Default to pairwise unless explicitly asked for higher strength.
74
+
75
+ ```bash
76
+ cat schema.json | lattice generate
77
+ ```
78
+
79
+ 5. **Interpret the output.** Plan mode: rows become plan revisions, missing decisions, review scenarios. Test mode: rows become assertions (see [Test Mode Discipline](#test-mode-discipline) below). Variant mode: rows become fixtures, rendered variants, screenshots, visual-diff inputs.
80
+
81
+ ## Constraint Selection
82
+
83
+ | Rule shape | Use |
84
+ |---|---|
85
+ | Two assignments cannot coexist | `invalid_pair` |
86
+ | One-to-one pairing (if A then B and if B then A) | `bidirectional` |
87
+ | A requires B, but B may appear elsewhere | `forward_dep` |
88
+ | Child parameter only applies for some parent values | `conditional` |
89
+ | This assignment set must appear in at least one row | `forced` |
90
+ | Rule only breaks under three or more antecedents | `higher_order` |
91
+
92
+ Prefer the smallest constraint type that matches. Use `conditional` instead of hand-writing `N/A` values.
93
+
94
+ ## Test Mode Discipline
95
+
96
+ Source expected behavior from intent — the user's request, a spec, a PRD, a ticket, or explicit reasoning about what the system *should* do. **The code under test is evidence, not truth.** If intent is ambiguous for a row, stop and ask the user.
97
+
98
+ Do not silently encode current behavior and hedge with `bug_signal:`-style annotations. That produces characterization tests, which lock in the implementation (bugs included) instead of catching divergence from intent. The asymmetries Lattice is designed to expose disappear when the test suite mirrors the same mental model as the code.
99
+
100
+ ## Common Pitfalls
101
+
102
+ ❌ Strip constraints to make generation easier, then mark impossible rows invalid after the fact.
103
+ ✅ Encode the constraint in the schema, regenerate. Encoding constraints changes the coverage universe to valid interactions — that's the point.
104
+
105
+ ❌ Write tests that assert what the code currently does.
106
+ ✅ Write tests that assert what the spec, PRD, or user requested. If intent is ambiguous, ask before writing.
107
+
108
+ ❌ Separate parameters for two fields where one determines the other (e.g., `currency` and `currency_symbol`).
109
+ ✅ One parameter plus a constraint expressing the dependency.
110
+
111
+ ❌ Brittle, prose-y value names (`payment_with_apple_pay_using_new_token_flow`).
112
+ ✅ Compact partitions: `apple_pay`, `apple_pay_new_token`.
113
+
114
+ ❌ Manually add or remove rows after `lattice generate`.
115
+ ✅ If the generated set is wrong, fix the schema. Hand-editing rows breaks the coverage guarantee.
116
+
117
+ ## References
118
+
119
+ - [references/modeling-rules.md](references/modeling-rules.md) — extraction heuristics, parameter selection, value partitioning, constraint guidance
120
+ - [references/worked-examples.md](references/worked-examples.md) — concrete examples in this repo
121
+
122
+ ## Development Fallback
123
+
124
+ In a checkout of the Lattice source where the package is not installed:
125
+
126
+ ```bash
127
+ cat schema.json | PYTHONPATH=src python3 -m lattice validate
128
+ cat schema.json | PYTHONPATH=src python3 -m lattice generate
129
+ ```
130
+
131
+ To install or refresh this skill from the installed package:
132
+
133
+ ```bash
134
+ lattice agent install-claude-skill
135
+ ```
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: lattice-workflow
3
+ description: Use when planning or testing behavior or variant surfaces with interacting states, roles, permissions, feature flags, modes, providers, optional fields, component props, rendering branches, template variants, config matrices, lifecycle states, combinatorial edge cases, pairwise coverage, or t-way coverage. Extract a Lattice schema, run the local Lattice CLI, and use generated rows to strengthen plans, tests, fixtures, rendered variants, or review matrices.
4
+ ---
5
+
6
+ # Lattice Workflow
7
+
8
+ Use this skill to keep the agent on extraction and interpretation while Lattice handles the combinatorics.
9
+
10
+ ## When To Use It
11
+
12
+ - derive a combinatorial model from a feature or PRD
13
+ - derive a test matrix from existing code
14
+ - derive a variant matrix from a component, partial, template, design-system story, or config surface
15
+ - convert edge cases into explicit parameter/value constraints
16
+ - generate pairwise or 3-way scenarios without hand-enumerating combinations
17
+ - render a compact visual review matrix instead of every possible variant
18
+ - review a plan involving roles, permissions, modes, providers, feature flags, optional fields, component props, rendering branches, template variants, config matrices, or lifecycle states
19
+ - find coverage gaps where bugs hide in interactions rather than single branches
20
+
21
+ ## When NOT To Use It
22
+
23
+ - **Small enumerable spaces.** Fewer than ~10 total combinations — enumerate by hand.
24
+ - **Independent dimensions.** No interactions can surface a bug; each parameter affects behavior independently.
25
+ - **Non-deterministic systems.** The same input row won't produce repeatable output (e.g., testing LLM responses).
26
+
27
+ ## Minimal Example
28
+
29
+ A schema (YAML on stdin):
30
+
31
+ ```yaml
32
+ model_name: checkout
33
+ parameters:
34
+ user: [signed_in, guest]
35
+ payment: [card, apple_pay, paypal]
36
+ cart: [empty, single, multi]
37
+ constraints:
38
+ - invalid_pair: {payment: apple_pay, cart: empty}
39
+ ```
40
+
41
+ One generated row (JSON):
42
+
43
+ ```json
44
+ {"user": "guest", "payment": "card", "cart": "multi"}
45
+ ```
46
+
47
+ The schema is the contract. The generated rows are the source of truth. The schema file is optional transport.
48
+
49
+ ## Preflight
50
+
51
+ ```bash
52
+ command -v lattice >/dev/null 2>&1 && lattice --help >/dev/null
53
+ ```
54
+
55
+ If it fails, install from PyPI:
56
+
57
+ ```bash
58
+ pipx install lattice-cli
59
+ ```
60
+
61
+ ## Workflow
62
+
63
+ 1. **Extract the schema.** Choose one coherent interaction surface — one feature, one workflow, one service behavior, one endpoint family, one component's variant space, one template family, or one config matrix. Parameters represent independent decisions or state partitions. Values are meaningful partitions, not every literal in the codebase.
64
+
65
+ 2. **Encode constraints.** Use the smallest constraint type that matches the rule (see [Constraint Selection](#constraint-selection) below). Encode true impossibilities — do not strip them and mark invalid rows downstream.
66
+
67
+ 3. **Validate.**
68
+
69
+ ```bash
70
+ cat schema.json | lattice validate
71
+ ```
72
+
73
+ 4. **Generate.** Default to pairwise unless explicitly asked for higher strength.
74
+
75
+ ```bash
76
+ cat schema.json | lattice generate
77
+ ```
78
+
79
+ 5. **Interpret the output.** Plan mode: rows become plan revisions, missing decisions, review scenarios. Test mode: rows become assertions (see [Test Mode Discipline](#test-mode-discipline) below). Variant mode: rows become fixtures, rendered variants, screenshots, visual-diff inputs.
80
+
81
+ ## Constraint Selection
82
+
83
+ | Rule shape | Use |
84
+ |---|---|
85
+ | Two assignments cannot coexist | `invalid_pair` |
86
+ | One-to-one pairing (if A then B and if B then A) | `bidirectional` |
87
+ | A requires B, but B may appear elsewhere | `forward_dep` |
88
+ | Child parameter only applies for some parent values | `conditional` |
89
+ | This assignment set must appear in at least one row | `forced` |
90
+ | Rule only breaks under three or more antecedents | `higher_order` |
91
+
92
+ Prefer the smallest constraint type that matches. Use `conditional` instead of hand-writing `N/A` values.
93
+
94
+ ## Test Mode Discipline
95
+
96
+ Source expected behavior from intent — the user's request, a spec, a PRD, a ticket, or explicit reasoning about what the system *should* do. **The code under test is evidence, not truth.** If intent is ambiguous for a row, stop and ask the user.
97
+
98
+ Do not silently encode current behavior and hedge with `bug_signal:`-style annotations. That produces characterization tests, which lock in the implementation (bugs included) instead of catching divergence from intent. The asymmetries Lattice is designed to expose disappear when the test suite mirrors the same mental model as the code.
99
+
100
+ ## Common Pitfalls
101
+
102
+ ❌ Strip constraints to make generation easier, then mark impossible rows invalid after the fact.
103
+ ✅ Encode the constraint in the schema, regenerate. Encoding constraints changes the coverage universe to valid interactions — that's the point.
104
+
105
+ ❌ Write tests that assert what the code currently does.
106
+ ✅ Write tests that assert what the spec, PRD, or user requested. If intent is ambiguous, ask before writing.
107
+
108
+ ❌ Separate parameters for two fields where one determines the other (e.g., `currency` and `currency_symbol`).
109
+ ✅ One parameter plus a constraint expressing the dependency.
110
+
111
+ ❌ Brittle, prose-y value names (`payment_with_apple_pay_using_new_token_flow`).
112
+ ✅ Compact partitions: `apple_pay`, `apple_pay_new_token`.
113
+
114
+ ❌ Manually add or remove rows after `lattice generate`.
115
+ ✅ If the generated set is wrong, fix the schema. Hand-editing rows breaks the coverage guarantee.
116
+
117
+ ## References
118
+
119
+ - [references/modeling-rules.md](references/modeling-rules.md) — extraction heuristics, parameter selection, value partitioning, constraint guidance
120
+ - [references/worked-examples.md](references/worked-examples.md) — concrete examples in this repo
121
+
122
+ ## Development Fallback
123
+
124
+ In a checkout of the Lattice source where the package is not installed:
125
+
126
+ ```bash
127
+ cat schema.json | PYTHONPATH=src python3 -m lattice validate
128
+ cat schema.json | PYTHONPATH=src python3 -m lattice generate
129
+ ```
130
+
131
+ To install or refresh this skill from the installed package:
132
+
133
+ ```bash
134
+ lattice agent install-codex-skill
135
+ ```
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: lattice-workflow
3
+ description: Use when planning or testing behavior or variant surfaces with interacting states, roles, permissions, feature flags, modes, providers, optional fields, component props, rendering branches, template variants, config matrices, lifecycle states, combinatorial edge cases, pairwise coverage, or t-way coverage. Extract a Lattice schema, run the local Lattice CLI, and use generated rows to strengthen plans, tests, fixtures, rendered variants, or review matrices.
4
+ ---
5
+
6
+ # Lattice Workflow
7
+
8
+ Use this skill to keep the agent on extraction and interpretation while Lattice handles the combinatorics.
9
+
10
+ ## When To Use It
11
+
12
+ - derive a combinatorial model from a feature or PRD
13
+ - derive a test matrix from existing code
14
+ - derive a variant matrix from a component, partial, template, design-system story, or config surface
15
+ - convert edge cases into explicit parameter/value constraints
16
+ - generate pairwise or 3-way scenarios without hand-enumerating combinations
17
+ - render a compact visual review matrix instead of every possible variant
18
+ - review a plan involving roles, permissions, modes, providers, feature flags, optional fields, component props, rendering branches, template variants, config matrices, or lifecycle states
19
+ - find coverage gaps where bugs hide in interactions rather than single branches
20
+
21
+ ## When NOT To Use It
22
+
23
+ - **Small enumerable spaces.** Fewer than ~10 total combinations — enumerate by hand.
24
+ - **Independent dimensions.** No interactions can surface a bug; each parameter affects behavior independently.
25
+ - **Non-deterministic systems.** The same input row won't produce repeatable output (e.g., testing LLM responses).
26
+
27
+ ## Minimal Example
28
+
29
+ A schema (YAML on stdin):
30
+
31
+ ```yaml
32
+ model_name: checkout
33
+ parameters:
34
+ user: [signed_in, guest]
35
+ payment: [card, apple_pay, paypal]
36
+ cart: [empty, single, multi]
37
+ constraints:
38
+ - invalid_pair: {payment: apple_pay, cart: empty}
39
+ ```
40
+
41
+ One generated row (JSON):
42
+
43
+ ```json
44
+ {"user": "guest", "payment": "card", "cart": "multi"}
45
+ ```
46
+
47
+ The schema is the contract. The generated rows are the source of truth. The schema file is optional transport.
48
+
49
+ ## Preflight
50
+
51
+ ```bash
52
+ command -v lattice >/dev/null 2>&1 && lattice --help >/dev/null
53
+ ```
54
+
55
+ If it fails, install from PyPI:
56
+
57
+ ```bash
58
+ pipx install lattice-cli
59
+ ```
60
+
61
+ ## Workflow
62
+
63
+ 1. **Extract the schema.** Choose one coherent interaction surface — one feature, one workflow, one service behavior, one endpoint family, one component's variant space, one template family, or one config matrix. Parameters represent independent decisions or state partitions. Values are meaningful partitions, not every literal in the codebase.
64
+
65
+ 2. **Encode constraints.** Use the smallest constraint type that matches the rule (see [Constraint Selection](#constraint-selection) below). Encode true impossibilities — do not strip them and mark invalid rows downstream.
66
+
67
+ 3. **Validate.**
68
+
69
+ ```bash
70
+ cat schema.json | lattice validate
71
+ ```
72
+
73
+ 4. **Generate.** Default to pairwise unless explicitly asked for higher strength.
74
+
75
+ ```bash
76
+ cat schema.json | lattice generate
77
+ ```
78
+
79
+ 5. **Interpret the output.** Plan mode: rows become plan revisions, missing decisions, review scenarios. Test mode: rows become assertions (see [Test Mode Discipline](#test-mode-discipline) below). Variant mode: rows become fixtures, rendered variants, screenshots, visual-diff inputs.
80
+
81
+ ## Constraint Selection
82
+
83
+ | Rule shape | Use |
84
+ |---|---|
85
+ | Two assignments cannot coexist | `invalid_pair` |
86
+ | One-to-one pairing (if A then B and if B then A) | `bidirectional` |
87
+ | A requires B, but B may appear elsewhere | `forward_dep` |
88
+ | Child parameter only applies for some parent values | `conditional` |
89
+ | This assignment set must appear in at least one row | `forced` |
90
+ | Rule only breaks under three or more antecedents | `higher_order` |
91
+
92
+ Prefer the smallest constraint type that matches. Use `conditional` instead of hand-writing `N/A` values.
93
+
94
+ ## Test Mode Discipline
95
+
96
+ Source expected behavior from intent — the user's request, a spec, a PRD, a ticket, or explicit reasoning about what the system *should* do. **The code under test is evidence, not truth.** If intent is ambiguous for a row, stop and ask the user.
97
+
98
+ Do not silently encode current behavior and hedge with `bug_signal:`-style annotations. That produces characterization tests, which lock in the implementation (bugs included) instead of catching divergence from intent. The asymmetries Lattice is designed to expose disappear when the test suite mirrors the same mental model as the code.
99
+
100
+ ## Common Pitfalls
101
+
102
+ ❌ Strip constraints to make generation easier, then mark impossible rows invalid after the fact.
103
+ ✅ Encode the constraint in the schema, regenerate. Encoding constraints changes the coverage universe to valid interactions — that's the point.
104
+
105
+ ❌ Write tests that assert what the code currently does.
106
+ ✅ Write tests that assert what the spec, PRD, or user requested. If intent is ambiguous, ask before writing.
107
+
108
+ ❌ Separate parameters for two fields where one determines the other (e.g., `currency` and `currency_symbol`).
109
+ ✅ One parameter plus a constraint expressing the dependency.
110
+
111
+ ❌ Brittle, prose-y value names (`payment_with_apple_pay_using_new_token_flow`).
112
+ ✅ Compact partitions: `apple_pay`, `apple_pay_new_token`.
113
+
114
+ ❌ Manually add or remove rows after `lattice generate`.
115
+ ✅ If the generated set is wrong, fix the schema. Hand-editing rows breaks the coverage guarantee.
116
+
117
+ ## References
118
+
119
+ - [references/modeling-rules.md](references/modeling-rules.md) — extraction heuristics, parameter selection, value partitioning, constraint guidance
120
+ - [references/worked-examples.md](references/worked-examples.md) — concrete examples in this repo
121
+
122
+ ## Development Fallback
123
+
124
+ In a checkout of the Lattice source where the package is not installed:
125
+
126
+ ```bash
127
+ cat schema.json | PYTHONPATH=src python3 -m lattice validate
128
+ cat schema.json | PYTHONPATH=src python3 -m lattice generate
129
+ ```
130
+
131
+ To install or refresh a copy of this skill from the installed package:
132
+
133
+ ```bash
134
+ lattice agent install-skill /path/to/harness/skills/lattice-workflow
135
+ ```
136
+
137
+ For harnesses that don't use skill directories, copy the output of:
138
+
139
+ ```bash
140
+ lattice agent instructions
141
+ ```
142
+
143
+ into the harness memory, system instruction, rule file, or project instruction mechanism.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lattice-cli
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Deterministic combinatorial coverage for agent workflows and constrained variant surfaces.
5
5
  Author-email: Tyler Klose <tylerklose@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -1,115 +0,0 @@
1
- ---
2
- name: lattice-workflow
3
- description: Use when planning or testing behavior or variant surfaces with interacting states, roles, permissions, feature flags, modes, providers, optional fields, component props, rendering branches, template variants, config matrices, lifecycle states, combinatorial edge cases, pairwise coverage, or t-way coverage. Extract a Lattice schema, run the local Lattice CLI, and use generated rows to strengthen plans, tests, fixtures, rendered variants, or review matrices.
4
- ---
5
-
6
- # Lattice Workflow
7
-
8
- Use this skill to keep Claude on extraction and interpretation while Lattice handles combinatorial coverage.
9
-
10
- ## When To Use It
11
-
12
- Use this skill when the task is any of:
13
-
14
- - derive a combinatorial model from a feature or PRD
15
- - derive a test matrix from existing code
16
- - derive a variant matrix from a component, partial, template, design-system story, or config surface
17
- - convert edge cases into explicit parameter/value constraints
18
- - generate pairwise or 3-way scenarios without hand-enumerating combinations
19
- - render a compact visual review matrix instead of every possible variant
20
- - review a plan involving roles, permissions, modes, providers, feature flags, optional fields, component props, rendering branches, template variants, config matrices, or lifecycle states
21
- - find coverage gaps where bugs are likely to hide in interactions rather than single branches
22
-
23
- Do not invent pairwise combinations manually. The schema is the contract. The generated rows are the source of truth. The schema file is optional transport.
24
-
25
- ## Preflight
26
-
27
- Before using this skill, check whether `lattice` is already installed:
28
-
29
- ```bash
30
- command -v lattice >/dev/null 2>&1 && lattice --help >/dev/null
31
- ```
32
-
33
- If that succeeds, use the installed command.
34
-
35
- If it fails, install from PyPI:
36
-
37
- ```bash
38
- pipx install lattice-cli
39
- ```
40
-
41
- Or, if you have a local Lattice source checkout (for development):
42
-
43
- ```bash
44
- python3 -m pip install -e /path/to/lattice
45
- ```
46
-
47
- To install or refresh this skill from the installed package:
48
-
49
- ```bash
50
- lattice agent install-claude-skill
51
- ```
52
-
53
- ## Workflow
54
-
55
- 1. Extract the schema.
56
- First choose the scope. A schema should usually describe one coherent interaction surface: one feature, one workflow, one service behavior, one endpoint family, one rendering surface, one component's variant space, one template family, one config matrix, or one data-model interaction surface. Then choose parameters that represent independent decisions or state partitions inside that scope. Choose values that are meaningful partitions, not every literal in the codebase.
57
- 2. Encode constraints.
58
- Prefer the smallest constraint type that matches the rule. Lattice supports exclusion-style constraints, not only conditional parameters: use `invalid_pair` when two assignments cannot coexist and `higher_order` when a combination only becomes invalid with multiple antecedents. Use `conditional` instead of hand-writing `N/A` values.
59
- 3. Validate before generation.
60
- Prefer the installed `lattice` command with JSON or YAML on stdin:
61
-
62
- ```bash
63
- cat schema.json | lattice validate
64
- ```
65
-
66
- If you are working inside this repository and the package is not installed yet, the fallback is:
67
-
68
- ```bash
69
- cat schema.json | PYTHONPATH=src python3 -m lattice validate
70
- ```
71
-
72
- Use a temp file only if the harness needs one for debugging or tool interop.
73
- 4. Generate deterministic scenarios.
74
-
75
- ```bash
76
- cat schema.json | lattice generate
77
- ```
78
-
79
- The development fallback in this repo is:
80
-
81
- ```bash
82
- cat schema.json | PYTHONPATH=src python3 -m lattice generate
83
- ```
84
-
85
- Default to pairwise unless the user explicitly asks for a higher strength.
86
- 5. Interpret the output.
87
- In plan mode, turn rows into plan revisions, missing decisions, and review scenarios. In test mode, diff the rows against the existing tests and write the missing cases. In variant mode, turn rows into fixtures, rendered variants, screenshots, contact sheets, visual diff inputs, or review checklists.
88
-
89
- In test mode, source expected behavior from intent — the user's request, a spec, a PRD, a ticket, or explicit reasoning about what the system *should* do. The code under test is evidence, not truth. If intent is ambiguous for a row, stop and ask the user. Do not silently encode current behavior and hedge with `bug_signal:`-style annotations: that produces characterization tests, which lock in the implementation (bugs included) instead of catching divergence from intent. The asymmetries Lattice is designed to expose disappear when the test suite mirrors the same mental model as the code.
90
-
91
- ## Modeling Rules
92
-
93
- - Scope one schema to one interaction surface. Do not default to the whole app unless the app is genuinely small and the behavior or rendering surface is still coherent.
94
- - Keep parameter names stable and implementation-adjacent.
95
- - Use value partitions such as `present` and `absent`, not brittle prose.
96
- - Avoid derived duplicate parameters. If one field is determined by another, represent that as a constraint.
97
- - Add constraints only for true business or system rules. Do not use them to encode preferences.
98
- - Do not strip true constraints to make generation easier, and do not generate nonsensical rows just to mark them invalid later. Encoding constraints changes the coverage universe to valid interactions, which is the point of using Lattice.
99
- - If two assignments cannot coexist, use `invalid_pair`.
100
- - If a parameter only matters under a parent value, use `conditional`.
101
- - If a scenario must appear at least once, use `forced`.
102
- - If a rule only breaks under multiple antecedents, use `higher_order`.
103
-
104
- Read [references/modeling-rules.md](references/modeling-rules.md) when you need extraction heuristics or constraint selection guidance.
105
-
106
- ## Output Discipline
107
-
108
- - Run `validate` before `generate`.
109
- - Prefer stdin and JSON because another agent step usually consumes the output.
110
- - Do not add or remove rows after generation.
111
- - If validation fails, fix the schema instead of weakening the generation step.
112
- - If generation emits rows that are impossible in the target system, stop and add the missing constraint rather than filtering or annotating those rows downstream.
113
- - In test mode, assertions must reflect intended behavior, not observed behavior. Read intent from the spec, PRD, ticket, or user — never from the code under test. If intent is ambiguous, stop and ask.
114
-
115
- Read [references/worked-examples.md](references/worked-examples.md) for concrete examples in this repo.
@@ -1,124 +0,0 @@
1
- ---
2
- name: lattice-workflow
3
- description: Use when planning or testing behavior or variant surfaces with interacting states, roles, permissions, feature flags, modes, providers, optional fields, component props, rendering branches, template variants, config matrices, lifecycle states, combinatorial edge cases, pairwise coverage, or t-way coverage. Extract a Lattice schema, run the local Lattice CLI, and use generated rows to strengthen plans, tests, fixtures, rendered variants, or review matrices.
4
- ---
5
-
6
- # Lattice Workflow
7
-
8
- Use this skill to keep the agent on the extraction and interpretation work while Lattice handles the combinatorics.
9
-
10
- ## When To Use It
11
-
12
- Use this skill when the task is any of:
13
-
14
- - derive a combinatorial model from a feature or PRD
15
- - derive a test matrix from existing code
16
- - derive a variant matrix from a component, partial, template, design-system story, or config surface
17
- - convert edge cases into explicit parameter/value constraints
18
- - generate pairwise or 3-way scenarios without hand-enumerating combinations
19
- - render a compact visual review matrix instead of every possible variant
20
- - review a plan involving roles, permissions, modes, providers, feature flags, optional fields, component props, rendering branches, template variants, config matrices, or lifecycle states
21
- - find coverage gaps where bugs are likely to hide in interactions rather than single branches
22
-
23
- Do not use this skill to invent pairwise combinations manually. The schema is the contract. The generated rows are the source of truth. The schema file is optional transport.
24
-
25
- ## Preflight
26
-
27
- Before using this skill, check whether `lattice` is already installed:
28
-
29
- ```bash
30
- command -v lattice >/dev/null 2>&1 && lattice --help >/dev/null
31
- ```
32
-
33
- If that succeeds, use the installed command.
34
-
35
- If it fails, install from PyPI:
36
-
37
- ```bash
38
- pipx install lattice-cli
39
- ```
40
-
41
- Or, if you have a local Lattice source checkout (for development):
42
-
43
- ```bash
44
- python3 -m pip install -e /path/to/lattice
45
- ```
46
-
47
- To install or refresh this skill from the installed package:
48
-
49
- ```bash
50
- lattice agent bootstrap
51
- ```
52
-
53
- If the skill was copied from a Lattice checkout, the agent setup page is available at `docs/install.md` in that checkout.
54
-
55
- In this repository, the development fallback remains:
56
-
57
- ```bash
58
- cat schema.json | PYTHONPATH=src python3 -m lattice validate
59
- cat schema.json | PYTHONPATH=src python3 -m lattice generate
60
- ```
61
-
62
- ## Workflow
63
-
64
- 1. Extract the schema.
65
- First choose the scope. A schema should usually describe one coherent interaction surface: one feature, one workflow, one service behavior, one endpoint family, one rendering surface, one component's variant space, one template family, one config matrix, or one data-model interaction surface. Then choose parameters that represent independent decisions or state partitions inside that scope. Choose values that are meaningful partitions, not every literal in the codebase.
66
- 2. Encode constraints.
67
- Prefer the smallest constraint type that matches the rule. Lattice supports exclusion-style constraints, not only conditional parameters: use `invalid_pair` when two assignments cannot coexist and `higher_order` when a combination only becomes invalid with multiple antecedents. Use `conditional` instead of hand-writing `N/A` values.
68
- 3. Validate before generation.
69
- Prefer the installed `lattice` command with JSON or YAML on stdin:
70
-
71
- ```bash
72
- cat schema.json | lattice validate
73
- ```
74
-
75
- If you are working inside this repository and the package is not installed yet, the fallback is:
76
-
77
- ```bash
78
- cat schema.json | PYTHONPATH=src python3 -m lattice validate
79
- ```
80
-
81
- Use a temp file only if the harness needs one for debugging or tool interop.
82
- 4. Generate deterministic scenarios.
83
-
84
- ```bash
85
- cat schema.json | lattice generate
86
- ```
87
-
88
- The development fallback in this repo is:
89
-
90
- ```bash
91
- cat schema.json | PYTHONPATH=src python3 -m lattice generate
92
- ```
93
-
94
- Default to pairwise unless the user explicitly asks for a higher strength.
95
- 5. Interpret the output.
96
- In plan mode, turn rows into plan revisions, missing decisions, and review scenarios. In test mode, diff the rows against the existing tests and write the missing cases. In variant mode, turn rows into fixtures, rendered variants, screenshots, contact sheets, visual diff inputs, or review checklists.
97
-
98
- In test mode, source expected behavior from intent — the user's request, a spec, a PRD, a ticket, or explicit reasoning about what the system *should* do. The code under test is evidence, not truth. If intent is ambiguous for a row, stop and ask the user. Do not silently encode current behavior and hedge with `bug_signal:`-style annotations: that produces characterization tests, which lock in the implementation (bugs included) instead of catching divergence from intent. The asymmetries Lattice is designed to expose disappear when the test suite mirrors the same mental model as the code.
99
-
100
- ## Modeling Rules
101
-
102
- - Scope one schema to one interaction surface. Do not default to the whole app unless the app is genuinely small and the behavior or rendering surface is still coherent.
103
- - Keep parameter names stable and implementation-adjacent.
104
- - Use value partitions such as `present` and `absent`, not brittle prose.
105
- - Avoid derived duplicate parameters. If one field is determined by another, represent that as a constraint.
106
- - Add constraints only for true business or system rules. Do not use them to encode preferences.
107
- - Do not strip true constraints to make generation easier, and do not generate nonsensical rows just to mark them invalid later. Encoding constraints changes the coverage universe to valid interactions, which is the point of using Lattice.
108
- - If two assignments cannot coexist, use `invalid_pair`.
109
- - If a parameter only matters under a parent value, use `conditional`.
110
- - If a scenario must appear at least once, use `forced`.
111
- - If a rule only breaks under multiple antecedents, use `higher_order`.
112
-
113
- Read [references/modeling-rules.md](references/modeling-rules.md) when you need extraction heuristics or constraint selection guidance.
114
-
115
- ## Output Discipline
116
-
117
- - Run `validate` before `generate`.
118
- - Prefer stdin and JSON because another agent step usually consumes the output.
119
- - Do not add or remove rows after generation.
120
- - If validation fails, fix the schema instead of weakening the generation step.
121
- - If generation emits rows that are impossible in the target system, stop and add the missing constraint rather than filtering or annotating those rows downstream.
122
- - In test mode, assertions must reflect intended behavior, not observed behavior. Read intent from the spec, PRD, ticket, or user — never from the code under test. If intent is ambiguous, stop and ask.
123
-
124
- Read [references/worked-examples.md](references/worked-examples.md) for concrete examples in this repo.
@@ -1,130 +0,0 @@
1
- ---
2
- name: lattice-workflow
3
- description: Use when planning or testing behavior or variant surfaces with interacting states, roles, permissions, feature flags, modes, providers, optional fields, component props, rendering branches, template variants, config matrices, lifecycle states, combinatorial edge cases, pairwise coverage, or t-way coverage. Extract a Lattice schema, run the local Lattice CLI, and use generated rows to strengthen plans, tests, fixtures, rendered variants, or review matrices.
4
- ---
5
-
6
- # Lattice Workflow
7
-
8
- Use this skill to keep the agent on the extraction and interpretation work while Lattice handles the combinatorics.
9
-
10
- ## When To Use It
11
-
12
- Use this skill when the task is any of:
13
-
14
- - derive a combinatorial model from a feature or PRD
15
- - derive a test matrix from existing code
16
- - derive a variant matrix from a component, partial, template, design-system story, or config surface
17
- - convert edge cases into explicit parameter/value constraints
18
- - generate pairwise or 3-way scenarios without hand-enumerating combinations
19
- - render a compact visual review matrix instead of every possible variant
20
- - review a plan involving roles, permissions, modes, providers, feature flags, optional fields, component props, rendering branches, template variants, config matrices, or lifecycle states
21
- - find coverage gaps where bugs are likely to hide in interactions rather than single branches
22
-
23
- Do not use this skill to invent pairwise combinations manually. The schema is the contract. The generated rows are the source of truth. The schema file is optional transport.
24
-
25
- ## Preflight
26
-
27
- Before using this skill, check whether `lattice` is already installed:
28
-
29
- ```bash
30
- command -v lattice >/dev/null 2>&1 && lattice --help >/dev/null
31
- ```
32
-
33
- If that succeeds, use the installed command.
34
-
35
- If it fails, install from PyPI:
36
-
37
- ```bash
38
- pipx install lattice-cli
39
- ```
40
-
41
- Or, if you have a local Lattice source checkout (for development):
42
-
43
- ```bash
44
- python3 -m pip install -e /path/to/lattice
45
- ```
46
-
47
- To install or refresh a generic copy of this skill from the installed package:
48
-
49
- ```bash
50
- lattice agent install-skill /path/to/harness/skills/lattice-workflow
51
- ```
52
-
53
- For harnesses that do not use skill directories, copy the output of:
54
-
55
- ```bash
56
- lattice agent instructions
57
- ```
58
-
59
- into the harness memory, system instruction, rule file, or project instruction mechanism.
60
-
61
- In this repository, the development fallback remains:
62
-
63
- ```bash
64
- cat schema.json | PYTHONPATH=src python3 -m lattice validate
65
- cat schema.json | PYTHONPATH=src python3 -m lattice generate
66
- ```
67
-
68
- ## Workflow
69
-
70
- 1. Extract the schema.
71
- First choose the scope. A schema should usually describe one coherent interaction surface: one feature, one workflow, one service behavior, one endpoint family, one rendering surface, one component's variant space, one template family, one config matrix, or one data-model interaction surface. Then choose parameters that represent independent decisions or state partitions inside that scope. Choose values that are meaningful partitions, not every literal in the codebase.
72
- 2. Encode constraints.
73
- Prefer the smallest constraint type that matches the rule. Lattice supports exclusion-style constraints, not only conditional parameters: use `invalid_pair` when two assignments cannot coexist and `higher_order` when a combination only becomes invalid with multiple antecedents. Use `conditional` instead of hand-writing `N/A` values.
74
- 3. Validate before generation.
75
- Prefer the installed `lattice` command with JSON or YAML on stdin:
76
-
77
- ```bash
78
- cat schema.json | lattice validate
79
- ```
80
-
81
- If you are working inside this repository and the package is not installed yet, the fallback is:
82
-
83
- ```bash
84
- cat schema.json | PYTHONPATH=src python3 -m lattice validate
85
- ```
86
-
87
- Use a temp file only if the harness needs one for debugging or tool interop.
88
- 4. Generate deterministic scenarios.
89
-
90
- ```bash
91
- cat schema.json | lattice generate
92
- ```
93
-
94
- The development fallback in this repo is:
95
-
96
- ```bash
97
- cat schema.json | PYTHONPATH=src python3 -m lattice generate
98
- ```
99
-
100
- Default to pairwise unless the user explicitly asks for a higher strength.
101
- 5. Interpret the output.
102
- In plan mode, turn rows into plan revisions, missing decisions, and review scenarios. In test mode, diff the rows against the existing tests and write the missing cases. In variant mode, turn rows into fixtures, rendered variants, screenshots, contact sheets, visual diff inputs, or review checklists.
103
-
104
- In test mode, source expected behavior from intent — the user's request, a spec, a PRD, a ticket, or explicit reasoning about what the system *should* do. The code under test is evidence, not truth. If intent is ambiguous for a row, stop and ask the user. Do not silently encode current behavior and hedge with `bug_signal:`-style annotations: that produces characterization tests, which lock in the implementation (bugs included) instead of catching divergence from intent. The asymmetries Lattice is designed to expose disappear when the test suite mirrors the same mental model as the code.
105
-
106
- ## Modeling Rules
107
-
108
- - Scope one schema to one interaction surface. Do not default to the whole app unless the app is genuinely small and the behavior or rendering surface is still coherent.
109
- - Keep parameter names stable and implementation-adjacent.
110
- - Use value partitions such as `present` and `absent`, not brittle prose.
111
- - Avoid derived duplicate parameters. If one field is determined by another, represent that as a constraint.
112
- - Add constraints only for true business or system rules. Do not use them to encode preferences.
113
- - Do not strip true constraints to make generation easier, and do not generate nonsensical rows just to mark them invalid later. Encoding constraints changes the coverage universe to valid interactions, which is the point of using Lattice.
114
- - If two assignments cannot coexist, use `invalid_pair`.
115
- - If a parameter only matters under a parent value, use `conditional`.
116
- - If a scenario must appear at least once, use `forced`.
117
- - If a rule only breaks under multiple antecedents, use `higher_order`.
118
-
119
- Read [references/modeling-rules.md](references/modeling-rules.md) when you need extraction heuristics or constraint selection guidance.
120
-
121
- ## Output Discipline
122
-
123
- - Run `validate` before `generate`.
124
- - Prefer stdin and JSON because another agent step usually consumes the output.
125
- - Do not add or remove rows after generation.
126
- - If validation fails, fix the schema instead of weakening the generation step.
127
- - If generation emits rows that are impossible in the target system, stop and add the missing constraint rather than filtering or annotating those rows downstream.
128
- - In test mode, assertions must reflect intended behavior, not observed behavior. Read intent from the spec, PRD, ticket, or user — never from the code under test. If intent is ambiguous, stop and ask.
129
-
130
- Read [references/worked-examples.md](references/worked-examples.md) for concrete examples in this repo.
File without changes
File without changes
File without changes