prodc 0.6.8__tar.gz → 0.7.0__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 (108) hide show
  1. {prodc-0.6.8 → prodc-0.7.0}/CHANGELOG.md +4 -0
  2. {prodc-0.6.8 → prodc-0.7.0}/PKG-INFO +1 -1
  3. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/__init__.py +1 -1
  4. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/catalog/ux.py +100 -41
  5. {prodc-0.6.8 → prodc-0.7.0}/.gitignore +0 -0
  6. {prodc-0.6.8 → prodc-0.7.0}/LICENSE +0 -0
  7. {prodc-0.6.8 → prodc-0.7.0}/README.md +0 -0
  8. {prodc-0.6.8 → prodc-0.7.0}/examples/quickstart/features/orders.feature +0 -0
  9. {prodc-0.6.8 → prodc-0.7.0}/examples/quickstart/needs/jordan.yaml +0 -0
  10. {prodc-0.6.8 → prodc-0.7.0}/examples/quickstart/prodc.toml +0 -0
  11. {prodc-0.6.8 → prodc-0.7.0}/pyproject.toml +0 -0
  12. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/adapters.py +0 -0
  13. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/agent.md +0 -0
  14. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/anchor.py +0 -0
  15. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/board.py +0 -0
  16. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/callbacks.py +0 -0
  17. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/catalog/__init__.py +0 -0
  18. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/cli/__init__.py +0 -0
  19. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/cli/__main__.py +0 -0
  20. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/cli/app.py +0 -0
  21. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/cli/commands.py +0 -0
  22. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/cli/common.py +0 -0
  23. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/cli/render.py +0 -0
  24. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/cli/serialize.py +0 -0
  25. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/config.py +0 -0
  26. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/dedup.py +0 -0
  27. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/glossary.py +0 -0
  28. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/guide.md +0 -0
  29. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/inbox.py +0 -0
  30. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/issues.py +0 -0
  31. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/loader.py +0 -0
  32. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/model.py +0 -0
  33. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/py.typed +0 -0
  34. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/report.py +0 -0
  35. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/report_export.py +0 -0
  36. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/report_html.py +0 -0
  37. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/status.py +0 -0
  38. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/storybook.py +0 -0
  39. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/views.py +0 -0
  40. {prodc-0.6.8 → prodc-0.7.0}/src/prodc/writer.py +0 -0
  41. {prodc-0.6.8 → prodc-0.7.0}/tests/fixtures/storybook/index.json +0 -0
  42. {prodc-0.6.8 → prodc-0.7.0}/tests/test_adapters.py +0 -0
  43. {prodc-0.6.8 → prodc-0.7.0}/tests/test_anchor.py +0 -0
  44. {prodc-0.6.8 → prodc-0.7.0}/tests/test_answer.py +0 -0
  45. {prodc-0.6.8 → prodc-0.7.0}/tests/test_attest_policy.py +0 -0
  46. {prodc-0.6.8 → prodc-0.7.0}/tests/test_awaits.py +0 -0
  47. {prodc-0.6.8 → prodc-0.7.0}/tests/test_callbacks.py +0 -0
  48. {prodc-0.6.8 → prodc-0.7.0}/tests/test_capture_block_scalar.py +0 -0
  49. {prodc-0.6.8 → prodc-0.7.0}/tests/test_catalog_add.py +0 -0
  50. {prodc-0.6.8 → prodc-0.7.0}/tests/test_catalog_lint.py +0 -0
  51. {prodc-0.6.8 → prodc-0.7.0}/tests/test_citation.py +0 -0
  52. {prodc-0.6.8 → prodc-0.7.0}/tests/test_claim_gating.py +0 -0
  53. {prodc-0.6.8 → prodc-0.7.0}/tests/test_cli.py +0 -0
  54. {prodc-0.6.8 → prodc-0.7.0}/tests/test_command_hook.py +0 -0
  55. {prodc-0.6.8 → prodc-0.7.0}/tests/test_confidence.py +0 -0
  56. {prodc-0.6.8 → prodc-0.7.0}/tests/test_config_keys.py +0 -0
  57. {prodc-0.6.8 → prodc-0.7.0}/tests/test_contradicts.py +0 -0
  58. {prodc-0.6.8 → prodc-0.7.0}/tests/test_decisions.py +0 -0
  59. {prodc-0.6.8 → prodc-0.7.0}/tests/test_declared_only.py +0 -0
  60. {prodc-0.6.8 → prodc-0.7.0}/tests/test_dedup.py +0 -0
  61. {prodc-0.6.8 → prodc-0.7.0}/tests/test_dedup_candidates.py +0 -0
  62. {prodc-0.6.8 → prodc-0.7.0}/tests/test_description.py +0 -0
  63. {prodc-0.6.8 → prodc-0.7.0}/tests/test_drafts.py +0 -0
  64. {prodc-0.6.8 → prodc-0.7.0}/tests/test_evalgate.py +0 -0
  65. {prodc-0.6.8 → prodc-0.7.0}/tests/test_expects.py +0 -0
  66. {prodc-0.6.8 → prodc-0.7.0}/tests/test_external_adapter.py +0 -0
  67. {prodc-0.6.8 → prodc-0.7.0}/tests/test_files_key.py +0 -0
  68. {prodc-0.6.8 → prodc-0.7.0}/tests/test_flowsteps.py +0 -0
  69. {prodc-0.6.8 → prodc-0.7.0}/tests/test_gitlab_source.py +0 -0
  70. {prodc-0.6.8 → prodc-0.7.0}/tests/test_glossary.py +0 -0
  71. {prodc-0.6.8 → prodc-0.7.0}/tests/test_importance.py +0 -0
  72. {prodc-0.6.8 → prodc-0.7.0}/tests/test_inbox.py +0 -0
  73. {prodc-0.6.8 → prodc-0.7.0}/tests/test_inventory.py +0 -0
  74. {prodc-0.6.8 → prodc-0.7.0}/tests/test_issues.py +0 -0
  75. {prodc-0.6.8 → prodc-0.7.0}/tests/test_lint_decision.py +0 -0
  76. {prodc-0.6.8 → prodc-0.7.0}/tests/test_loader.py +0 -0
  77. {prodc-0.6.8 → prodc-0.7.0}/tests/test_models.py +0 -0
  78. {prodc-0.6.8 → prodc-0.7.0}/tests/test_needref.py +0 -0
  79. {prodc-0.6.8 → prodc-0.7.0}/tests/test_path.py +0 -0
  80. {prodc-0.6.8 → prodc-0.7.0}/tests/test_path_views.py +0 -0
  81. {prodc-0.6.8 → prodc-0.7.0}/tests/test_playwright.py +0 -0
  82. {prodc-0.6.8 → prodc-0.7.0}/tests/test_principle_withdrawal.py +0 -0
  83. {prodc-0.6.8 → prodc-0.7.0}/tests/test_principles.py +0 -0
  84. {prodc-0.6.8 → prodc-0.7.0}/tests/test_relink.py +0 -0
  85. {prodc-0.6.8 → prodc-0.7.0}/tests/test_report.py +0 -0
  86. {prodc-0.6.8 → prodc-0.7.0}/tests/test_report_export.py +0 -0
  87. {prodc-0.6.8 → prodc-0.7.0}/tests/test_report_html.py +0 -0
  88. {prodc-0.6.8 → prodc-0.7.0}/tests/test_results_reports.py +0 -0
  89. {prodc-0.6.8 → prodc-0.7.0}/tests/test_review.py +0 -0
  90. {prodc-0.6.8 → prodc-0.7.0}/tests/test_roles.py +0 -0
  91. {prodc-0.6.8 → prodc-0.7.0}/tests/test_source_role.py +0 -0
  92. {prodc-0.6.8 → prodc-0.7.0}/tests/test_sources.py +0 -0
  93. {prodc-0.6.8 → prodc-0.7.0}/tests/test_stage.py +0 -0
  94. {prodc-0.6.8 → prodc-0.7.0}/tests/test_staleness.py +0 -0
  95. {prodc-0.6.8 → prodc-0.7.0}/tests/test_status.py +0 -0
  96. {prodc-0.6.8 → prodc-0.7.0}/tests/test_storybook.py +0 -0
  97. {prodc-0.6.8 → prodc-0.7.0}/tests/test_suggest.py +0 -0
  98. {prodc-0.6.8 → prodc-0.7.0}/tests/test_suggest_eval.py +0 -0
  99. {prodc-0.6.8 → prodc-0.7.0}/tests/test_ux_catalog.py +0 -0
  100. {prodc-0.6.8 → prodc-0.7.0}/tests/test_variants.py +0 -0
  101. {prodc-0.6.8 → prodc-0.7.0}/tests/test_view_links.py +0 -0
  102. {prodc-0.6.8 → prodc-0.7.0}/tests/test_views.py +0 -0
  103. {prodc-0.6.8 → prodc-0.7.0}/tests/test_views_report.py +0 -0
  104. {prodc-0.6.8 → prodc-0.7.0}/tests/test_vitest.py +0 -0
  105. {prodc-0.6.8 → prodc-0.7.0}/tests/test_who_variants.py +0 -0
  106. {prodc-0.6.8 → prodc-0.7.0}/tests/test_withdrawn.py +0 -0
  107. {prodc-0.6.8 → prodc-0.7.0}/tests/test_writer.py +0 -0
  108. {prodc-0.6.8 → prodc-0.7.0}/tests/test_writer_comments.py +0 -0
@@ -4,6 +4,8 @@ All notable changes are documented here. Versioning is [SemVer](https://semver.o
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.7.0] - 2026-11-09
8
+
7
9
  ### Added
8
10
 
9
11
  - A `storybook` proof kind: a need can point at the Storybook stories that show it. prodc
@@ -19,6 +21,8 @@ All notable changes are documented here. Versioning is [SemVer](https://semver.o
19
21
  - `prodc.catalog.ux` ships 30 UX laws from lawsofux.com as catalog entries (`UX_CATALOG`).
20
22
  Five are checkable (ux-fitts, ux-hick, ux-von-restorff, ux-miller, ux-jakob) and carry a
21
23
  `Recipe` with a snippet for the guard test. `docs/ux-laws.md` lists all 30.
24
+ The ux-fitts, ux-hick, and ux-von-restorff recipes now carry real guard code extracted from
25
+ crm (source-file scanning approach); ux-miller and ux-jakob keep placeholder snippets.
22
26
  - `Principle` now supports `withdrawn: {reason, date[, kind]}`, reusing the existing `Withdrawal`
23
27
  type. A withdrawn principle is not evaluated by lint. `prodc withdraw principle <id>` and
24
28
  `prodc reinstate principle <id>` write the field.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: prodc
3
- Version: 0.6.8
3
+ Version: 0.7.0
4
4
  Summary: Product management as code: roles, flows, and features traced to evidence.
5
5
  Project-URL: Homepage, https://gitlab.com/cardona-oss/prodc
6
6
  Project-URL: Repository, https://gitlab.com/cardona-oss/prodc
@@ -1,3 +1,3 @@
1
1
  """prodc: product management as code."""
2
2
 
3
- __version__ = "0.6.8" # the single source of truth; pyproject reads it via [tool.hatch.version]
3
+ __version__ = "0.7.0" # the single source of truth; pyproject reads it via [tool.hatch.version]
@@ -63,24 +63,42 @@ _FITTS = CatalogEntry(
63
63
  checkable=True,
64
64
  recipe=Recipe(
65
65
  kind="vitest",
66
- summary="Assert computed min-width/min-height on every interactive element.",
67
- # TODO: replace with the guard from crm/tyko once it is extracted.
66
+ summary="Test the pure button-style function: every size variant sets minHeight >= 24px.",
67
+ # Real guard from crm: apps/website/src/design/fittssLaw.guard.test.ts
68
+ # jsdom has no layout engine; test the pure style function instead of a rendered bounding box.
68
69
  snippet="""\
69
- // tests/design/tap-targets.test.ts
70
- import { getAllInteractiveElements } from './helpers'
71
-
72
- test('every interactive element meets the 24px minimum', () => {
73
- const elements = getAllInteractiveElements(document)
74
- for (const el of elements) {
75
- const style = getComputedStyle(el)
76
- const w = parseFloat(style.width)
77
- const h = parseFloat(style.height)
78
- expect(w, `${el.tagName}#${el.id} width`).toBeGreaterThanOrEqual(24)
79
- expect(h, `${el.tagName}#${el.id} height`).toBeGreaterThanOrEqual(24)
80
- }
81
- })
70
+ // src/design/fittssLaw.guard.test.ts
71
+ import { describe, expect, it } from "vitest";
72
+ import { buttonVisualStyle, type ButtonSize } from "./primitives/Button";
73
+
74
+ const SIZES: ButtonSize[] = ["sm", "md", "lg"];
75
+
76
+ describe("interactive targets meet the 24x24px minimum (WCAG 2.5.8)", () => {
77
+ it("every size variant sets minHeight >= 24px", () => {
78
+ for (const size of SIZES) {
79
+ const style = buttonVisualStyle({ size });
80
+ expect(
81
+ style.minHeight,
82
+ `size "${size}" minHeight ${style.minHeight} is below the 24px WCAG minimum`,
83
+ ).toBeGreaterThanOrEqual(24);
84
+ }
85
+ });
86
+
87
+ it("icon-only buttons set minWidth >= 24px (they form a square target)", () => {
88
+ for (const size of SIZES) {
89
+ const style = buttonVisualStyle({ size, iconOnly: true });
90
+ expect(style.minWidth).toBeGreaterThanOrEqual(24);
91
+ }
92
+ });
93
+
94
+ it("checks a real primitive, not an empty fixture", () => {
95
+ const style = buttonVisualStyle({ variant: "primary", size: "md" });
96
+ expect(style.minHeight).toBeDefined();
97
+ expect(SIZES.length).toBeGreaterThan(0);
98
+ });
99
+ });
82
100
  """,
83
- proof_locator_hint="vitest:tests/design/tap-targets.test.ts::every interactive element meets the 24px minimum",
101
+ proof_locator_hint="vitest:src/design/fittssLaw.guard.test.ts::interactive targets meet the 24x24px minimum (WCAG 2.5.8) > every size variant sets minHeight >= 24px",
84
102
  ),
85
103
  )
86
104
 
@@ -93,22 +111,37 @@ _HICK = CatalogEntry(
93
111
  checkable=True,
94
112
  recipe=Recipe(
95
113
  kind="vitest",
96
- summary="Count rendered items in each top-level nav component.",
97
- # TODO: replace with the guard from crm/tyko once it is extracted.
114
+ summary="Count top-level nav items per role; each must stay at or below the threshold set when the principle was written.",
115
+ # Real guard from crm: apps/website/src/design/hicksLaw.guard.test.ts
116
+ # Thresholds are the counts at adoption time; the guard prevents growth beyond them.
98
117
  snippet="""\
99
- // tests/design/nav-items.test.ts
100
- import { render } from '@testing-library/react'
101
- import { Navigation } from '../src/Navigation'
118
+ // src/design/hicksLaw.guard.test.ts
119
+ import { describe, expect, it } from "vitest";
120
+ import { sectionsForRole } from "../lib/navLens";
102
121
 
103
- const MAX_NAV_ITEMS = {N}
122
+ // Replace MAX_NAV_ITEMS with the current count per role in your app.
123
+ const MAX_NAV_ITEMS = {N};
104
124
 
105
- test('top-level nav has no more than {N} items', () => {
106
- const { getAllByRole } = render(<Navigation />)
107
- const items = getAllByRole('menuitem')
108
- expect(items.length).toBeLessThanOrEqual(MAX_NAV_ITEMS)
109
- })
125
+ describe("the main nav has at most {N} top-level sections per role", () => {
126
+ it("primary role sees at most {N} sections", () => {
127
+ const sections = sectionsForRole("primary");
128
+ expect(
129
+ sections.length,
130
+ `primary role now has ${sections.length} nav sections (threshold {N}) — ` +
131
+ "update this guard and the principle YAML if the addition is intentional",
132
+ ).toBeLessThanOrEqual(MAX_NAV_ITEMS);
133
+ });
134
+
135
+ it("watches a real nav lens: sections are non-empty and named", () => {
136
+ const sections = sectionsForRole("primary");
137
+ expect(sections.length).toBeGreaterThan(0);
138
+ for (const s of sections) {
139
+ expect(s).toMatch(/^\\//);
140
+ }
141
+ });
142
+ });
110
143
  """,
111
- proof_locator_hint="vitest:tests/design/nav-items.test.ts::top-level nav has no more than {N} items",
144
+ proof_locator_hint="vitest:src/design/hicksLaw.guard.test.ts::the main nav has at most {N} top-level sections per role > primary role sees at most {N} sections",
112
145
  ),
113
146
  )
114
147
 
@@ -123,21 +156,47 @@ _VON_RESTORFF = CatalogEntry(
123
156
  ),
124
157
  checkable=True,
125
158
  recipe=Recipe(
126
- kind="playwright",
127
- summary="Count primary-action buttons per form/dialog in each component.",
128
- # TODO: replace with the guard from crm/tyko once it is extracted.
159
+ kind="vitest",
160
+ summary="Grep form/dialog source files for variant=\"primary\"; each file must have at most one.",
161
+ # Real guard from crm: apps/website/src/design/vonRestorff.guard.test.ts
162
+ # jsdom has no layout; scan source files statically for variant="primary" in JSX.
129
163
  snippet="""\
130
- // tests/design/primary-buttons.spec.ts
131
- import { test, expect } from '@playwright/experimental-ct-react'
132
- import { MyForm } from '../src/MyForm'
133
-
134
- test('form has at most one primary button', async ({ mount }) => {
135
- const component = await mount(<MyForm />)
136
- const primaries = component.locator('[data-variant="primary"], .btn-primary')
137
- await expect(primaries).toHaveCount(1)
138
- })
164
+ // src/design/vonRestorff.guard.test.ts
165
+ import { readdirSync, readFileSync, statSync } from "node:fs";
166
+ import { join, relative } from "node:path";
167
+ import { describe, expect, it } from "vitest";
168
+
169
+ const SRC = join(import.meta.dirname, "..");
170
+ const FORM_PATTERN = /(?:Form|Dialog|Modal)\\.tsx$/;
171
+ const PRIMARY_BUTTON = /variant="primary"/g;
172
+
173
+ function formFiles(dir: string): string[] {
174
+ const out: string[] = [];
175
+ for (const entry of readdirSync(dir)) {
176
+ const full = join(dir, entry);
177
+ if (statSync(full).isDirectory()) out.push(...formFiles(full));
178
+ else if (FORM_PATTERN.test(entry)) out.push(full);
179
+ }
180
+ return out;
181
+ }
182
+
183
+ describe("at most one primary button per form or dialog", () => {
184
+ it("no form or dialog file contains more than one variant=\\"primary\\" button", () => {
185
+ const offenders: string[] = [];
186
+ for (const file of formFiles(SRC)) {
187
+ const src = readFileSync(file, "utf8");
188
+ const count = (src.match(PRIMARY_BUTTON) ?? []).length;
189
+ if (count > 1) offenders.push(`${relative(SRC, file)} (${count} primary buttons)`);
190
+ }
191
+ expect(offenders).toEqual([]);
192
+ });
193
+
194
+ it("watches a real tree: at least 10 form/dialog files must exist", () => {
195
+ expect(formFiles(SRC).length).toBeGreaterThanOrEqual(10);
196
+ });
197
+ });
139
198
  """,
140
- proof_locator_hint="playwright:tests/design/primary-buttons.spec.ts::form has at most one primary button",
199
+ proof_locator_hint="vitest:src/design/vonRestorff.guard.test.ts::at most one primary button per form or dialog > no form or dialog file contains more than one variant=\"primary\" button",
141
200
  ),
142
201
  )
143
202
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes