hotdocs 0.1.0a1__py3-none-any.whl

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 (113) hide show
  1. hotdocs/__init__.py +3 -0
  2. hotdocs/__main__.py +5 -0
  3. hotdocs/_entry.py +46 -0
  4. hotdocs/_tool/AUTHORING.md +185 -0
  5. hotdocs/_tool/QUICKSTART.md +308 -0
  6. hotdocs/_tool/SPEC_GUIDELINES.md +815 -0
  7. hotdocs/_tool/agent-skills/README.md +10 -0
  8. hotdocs/_tool/agent-skills/hotdocs-asset-kind/SKILL.md +121 -0
  9. hotdocs/_tool/examples/slugify/specs/components/slugify/acceptance/AC-SLUG-001.md +14 -0
  10. hotdocs/_tool/examples/slugify/specs/components/slugify/acceptance/AC-SLUG-002.md +14 -0
  11. hotdocs/_tool/examples/slugify/specs/components/slugify/acceptance/AC-SLUG-003.md +10 -0
  12. hotdocs/_tool/examples/slugify/specs/components/slugify/acceptance/AC-SLUG-004.md +18 -0
  13. hotdocs/_tool/examples/slugify/specs/components/slugify/component.md +51 -0
  14. hotdocs/_tool/examples/slugify/specs/components/slugify/constraints.md +3 -0
  15. hotdocs/_tool/examples/slugify/specs/components/slugify/interface/library.md +10 -0
  16. hotdocs/_tool/examples/slugify/specs/components/slugify/requirements/R-SLUG-001.md +5 -0
  17. hotdocs/_tool/examples/slugify/specs/components/slugify/requirements/R-SLUG-002.md +7 -0
  18. hotdocs/_tool/examples/slugify/specs/components/slugify/requirements/R-SLUG-003.md +5 -0
  19. hotdocs/_tool/examples/slugify/specs/components/slugify/requirements/R-SLUG-004.md +6 -0
  20. hotdocs/_tool/examples/slugify/specs/product/slugs.md +22 -0
  21. hotdocs/_tool/gen/README.md +24 -0
  22. hotdocs/_tool/gen/agentic-generator/.provenance.json +379 -0
  23. hotdocs/_tool/gen/agentic-generator/agentic_generator.py +427 -0
  24. hotdocs/_tool/gen/cache-manager/.provenance.json +458 -0
  25. hotdocs/_tool/gen/cache-manager/cache_manager.py +254 -0
  26. hotdocs/_tool/gen/capability-scenario-verifier/.provenance.json +469 -0
  27. hotdocs/_tool/gen/capability-scenario-verifier/capability_scenario_verifier.py +534 -0
  28. hotdocs/_tool/gen/citation-checker/.provenance.json +370 -0
  29. hotdocs/_tool/gen/citation-checker/citation_checker.py +219 -0
  30. hotdocs/_tool/gen/component-gate-runner/.provenance.json +375 -0
  31. hotdocs/_tool/gen/component-gate-runner/component_gate_runner.py +556 -0
  32. hotdocs/_tool/gen/corpus-graph-builder/.provenance.json +381 -0
  33. hotdocs/_tool/gen/corpus-graph-builder/corpus_graph_builder/__init__.py +192 -0
  34. hotdocs/_tool/gen/corpus-graph-builder/corpus_graph_builder/cli.py +51 -0
  35. hotdocs/_tool/gen/corpus-loader/.provenance.json +331 -0
  36. hotdocs/_tool/gen/corpus-loader/corpus_loader.py +249 -0
  37. hotdocs/_tool/gen/decision-drift-detector/.provenance.json +382 -0
  38. hotdocs/_tool/gen/decision-drift-detector/decision_drift_detector.py +338 -0
  39. hotdocs/_tool/gen/docs-site-renderer/.provenance.json +381 -0
  40. hotdocs/_tool/gen/docs-site-renderer/docs_site_renderer/__init__.py +188 -0
  41. hotdocs/_tool/gen/docs-site-renderer/docs_site_renderer/cli.py +69 -0
  42. hotdocs/_tool/gen/docs-site-renderer/static/app.js +111 -0
  43. hotdocs/_tool/gen/generation-loop/.provenance.json +341 -0
  44. hotdocs/_tool/gen/generation-loop/generation_loop.py +287 -0
  45. hotdocs/_tool/gen/generator/.provenance.json +600 -0
  46. hotdocs/_tool/gen/generator/generator.py +469 -0
  47. hotdocs/_tool/gen/graph-query-engine/.provenance.json +385 -0
  48. hotdocs/_tool/gen/graph-query-engine/graph_query_engine.py +230 -0
  49. hotdocs/_tool/gen/hotdocs-cli/.provenance.json +371 -0
  50. hotdocs/_tool/gen/hotdocs-cli/hotdocs_cli.py +339 -0
  51. hotdocs/_tool/gen/hotdocs-init/.provenance.json +342 -0
  52. hotdocs/_tool/gen/hotdocs-init/hotdocs_init.py +463 -0
  53. hotdocs/_tool/gen/impact-analyzer/.provenance.json +418 -0
  54. hotdocs/_tool/gen/impact-analyzer/impact_analyzer.py +350 -0
  55. hotdocs/_tool/gen/kind-javascript/.provenance.json +482 -0
  56. hotdocs/_tool/gen/kind-javascript/kind_javascript.py +371 -0
  57. hotdocs/_tool/gen/kind-python/.provenance.json +433 -0
  58. hotdocs/_tool/gen/kind-python/kind_python.py +371 -0
  59. hotdocs/_tool/gen/license-scanner/.provenance.json +508 -0
  60. hotdocs/_tool/gen/license-scanner/license_scanner.py +388 -0
  61. hotdocs/_tool/gen/llm-endpoint/.provenance.json +494 -0
  62. hotdocs/_tool/gen/llm-endpoint/llm_endpoint.py +638 -0
  63. hotdocs/_tool/gen/llm-tool-endpoint/.provenance.json +409 -0
  64. hotdocs/_tool/gen/llm-tool-endpoint/llm_tool_endpoint.py +465 -0
  65. hotdocs/_tool/gen/provenance-checker/.provenance.json +495 -0
  66. hotdocs/_tool/gen/provenance-checker/provenance_checker.py +492 -0
  67. hotdocs/_tool/gen/provenance-tracker/.provenance.json +354 -0
  68. hotdocs/_tool/gen/provenance-tracker/provenance_tracker.py +423 -0
  69. hotdocs/_tool/gen/provenance-tracker-ui/.provenance.json +376 -0
  70. hotdocs/_tool/gen/provenance-tracker-ui/provenance_tracker_ui.py +309 -0
  71. hotdocs/_tool/gen/provenance-tracker-ui/static/app.js +23 -0
  72. hotdocs/_tool/gen/provenance-writer/.provenance.json +602 -0
  73. hotdocs/_tool/gen/provenance-writer/provenance_writer.py +315 -0
  74. hotdocs/_tool/gen/review-packet-builder/.provenance.json +378 -0
  75. hotdocs/_tool/gen/review-packet-builder/review_packet_builder.py +299 -0
  76. hotdocs/_tool/gen/secret-scanner/.provenance.json +558 -0
  77. hotdocs/_tool/gen/secret-scanner/secret_scanner.py +553 -0
  78. hotdocs/_tool/gen/size-checker/.provenance.json +393 -0
  79. hotdocs/_tool/gen/size-checker/size_checker.py +248 -0
  80. hotdocs/_tool/gen/spec-bundle-assembler/.provenance.json +573 -0
  81. hotdocs/_tool/gen/spec-bundle-assembler/spec_bundle_assembler.py +472 -0
  82. hotdocs/_tool/gen/spec-completeness-assistant/.provenance.json +357 -0
  83. hotdocs/_tool/gen/spec-completeness-assistant/spec_completeness_assistant.py +412 -0
  84. hotdocs/_tool/gen/spec-linter/.provenance.json +741 -0
  85. hotdocs/_tool/gen/spec-linter/spec_linter.py +894 -0
  86. hotdocs/_tool/gen/spec-reviewer/.provenance.json +342 -0
  87. hotdocs/_tool/gen/spec-reviewer/spec_reviewer.py +527 -0
  88. hotdocs/_tool/gen/spec-scaffolder/.provenance.json +397 -0
  89. hotdocs/_tool/gen/spec-scaffolder/spec_scaffolder.py +535 -0
  90. hotdocs/_tool/gen/surface-checker/.provenance.json +334 -0
  91. hotdocs/_tool/gen/surface-checker/surface_checker.py +322 -0
  92. hotdocs/_tool/gen/test-author/.provenance.json +506 -0
  93. hotdocs/_tool/gen/test-author/test_author.py +465 -0
  94. hotdocs/_tool/gen/test-probe/.provenance.json +379 -0
  95. hotdocs/_tool/gen/test-probe/test_probe.py +424 -0
  96. hotdocs/_tool/gen/verifier-orchestrator/.provenance.json +655 -0
  97. hotdocs/_tool/gen/verifier-orchestrator/verifier_orchestrator.py +878 -0
  98. hotdocs/_tool/pipeline/README.md +26 -0
  99. hotdocs/_tool/pipeline/criterion-compiler/.sealed-provenance.json +17 -0
  100. hotdocs/_tool/pipeline/criterion-compiler/criterion_compiler.py +529 -0
  101. hotdocs/_tool/pyproject.toml +38 -0
  102. hotdocs/_tool/requirements.txt +6 -0
  103. hotdocs/_tool/specs/architecture/asset-kind-javascript.md +106 -0
  104. hotdocs/_tool/specs/architecture/asset-kind-python.md +115 -0
  105. hotdocs/_tool/specs/architecture/asset-kinds.md +240 -0
  106. hotdocs/_tool/specs/architecture/cli-conventions.md +47 -0
  107. hotdocs/_tool/specs/architecture/step-phrase-grammar.md +84 -0
  108. hotdocs-0.1.0a1.dist-info/METADATA +140 -0
  109. hotdocs-0.1.0a1.dist-info/RECORD +113 -0
  110. hotdocs-0.1.0a1.dist-info/WHEEL +5 -0
  111. hotdocs-0.1.0a1.dist-info/entry_points.txt +2 -0
  112. hotdocs-0.1.0a1.dist-info/licenses/LICENSE +190 -0
  113. hotdocs-0.1.0a1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,10 @@
1
+ # Agent skills
2
+
3
+ Instructions for a coding agent working in a project built with
4
+ `hotdocs`, in the Claude Code skill format (`<name>/SKILL.md`). They
5
+ ship with the tool; a project uses one by linking or copying it into
6
+ its own `.claude/skills/`.
7
+
8
+ - `hotdocs-asset-kind/`: define a new asset kind, or move a component's
9
+ embedded non-Python text into a declared asset
10
+ (`specs/architecture/asset-kinds.md`, `D340`).
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: hotdocs-asset-kind
3
+ description: Define a new hotdocs asset kind (a non-Python artifact type such as JavaScript, SQL, a data schema, a document or a prompt) for a project built with hotdocs, or move an existing component's embedded non-Python text into a declared asset. Use when the user wants a component to produce something other than a Python package, asks how hotdocs can spec another language or file type, or a component holds another language inside Python strings.
4
+ ---
5
+
6
+ # Defining a hotdocs asset kind
7
+
8
+ The contract is `specs/architecture/asset-kinds.md`. Read it first, every
9
+ time; this skill is the procedure for meeting it, not a substitute. It
10
+ ships with the tool, not in a project: look under the directory that
11
+ holds the tool's `QUICKSTART.md` (`hotdocs init` prints that path), where
12
+ the built-in kinds' definitions, `asset-kind-python.md` and
13
+ `asset-kind-javascript.md`, sit beside it as worked examples. A
14
+ kind is only useful if its gates are as strict as Python's, so most of
15
+ this procedure is about the strength check and the test-only text, where
16
+ past failures came from.
17
+
18
+ ## 1. Establish the asset before writing anything
19
+
20
+ Ask the user, or find in the code, and write down:
21
+
22
+ - What the asset is, concretely: one file or several, its language or
23
+ format, and one real example from this project.
24
+ - Who consumes it: another component, a browser, a database, a model, a
25
+ human reader. The consumer decides the surface.
26
+ - What would make it wrong in a way that matters. List at least five
27
+ concrete wrong versions. If you cannot, the strength check will be
28
+ weak; stop and work this out with the user.
29
+ - What must be installed to run or check it, with versions.
30
+
31
+ Check `<tool_root>/gen/kind-*/` for a built-in kind (an adapter) that
32
+ already fits. Prefer extending a built-in kind's declaration over a new kind.
33
+
34
+ Decisions that are the user's, not yours: adding an environment (a
35
+ program or package set) the project does not already need; choosing evaluation (model calls on every
36
+ verification) as a strength check; anything that makes a gate skip
37
+ instead of fail.
38
+
39
+ ## 2. Write the definition, strength check first
40
+
41
+ Create `specs/architecture/asset-kind-<kind>.md` with the seven parts the contract
42
+ lists. Write them in this order:
43
+
44
+ 1. **Strength check.** Pick mutation for executable code, perturbation
45
+ for documents, data and templates, evaluation only for text that
46
+ drives a model. List every site or perturbation explicitly. Each of
47
+ the wrong versions from step 1 must correspond to at least one site.
48
+ 2. **Surface.** Exactly what a consumer relies on, extractable by code
49
+ without judgement.
50
+ 3. **Running criteria.** What `asset_runner` takes and returns, with one
51
+ example call and result. Inputs and outputs are JSON-shaped, so
52
+ tests stay plain pytest.
53
+ 4. **Layout**, **environment** (programs with versions, the lockfile,
54
+ and how `provision` reports failure), then the two guidance texts.
55
+ Never rely on packages from `hotdocs`' own environment.
56
+
57
+ ## 3. Keep test text and generator text apart
58
+
59
+ - Test author guidance holds fixture mechanics only: how to build a
60
+ fixture, how to call `asset_runner`, where files go. Never restate a
61
+ requirement; tests check requirements, not a paraphrase.
62
+ - Generator guidance holds conventions the asset must follow. Never
63
+ test mechanics.
64
+ - Shapes the asset itself reads (an input file's format, a schema it
65
+ validates against) are interface text, visible to both.
66
+
67
+ ## 4. Close the gaps that broke tests before
68
+
69
+ Every rule a test needs must be written down; a test author that has to
70
+ guess will guess differently on each run. Check the definition states:
71
+
72
+ - Where every fixture file lives, relative to what, and how a test
73
+ finds any real file it copies. Never "from the live repository" or
74
+ the current directory: verification and mutation runs use different
75
+ directories (`D324`, `D336`, `D339`).
76
+ - The exact text or JSON of any reply, message or error a test asserts.
77
+ - What a test must not do: shell out to the environment's programs directly, depend
78
+ on wall-clock time or network, define top-level `test*` helpers.
79
+ - How a fake or stand-in is installed, if tests need one.
80
+
81
+ ## 5. Build and calibrate the adapter
82
+
83
+ 1. Write `comp-kind-<kind>`'s spec with the adapter interface from the
84
+ contract, and acceptance criteria that include two calibration
85
+ assets: a correct one whose suite scores at or above the bar, and a
86
+ deliberately weak suite that scores below it. A strength check that
87
+ cannot fail is a defect.
88
+ 2. Add a draft decision recording the kind and why it is needed
89
+ (`hotdocs decision new`).
90
+ 3. Run `hotdocs lint`, then `hotdocs spec check` on the kind's
91
+ component, and resolve every finding.
92
+ 4. Generate the adapter with `hotdocs generate comp-kind-<kind>`; it
93
+ must land with provenance like any component.
94
+ 5. Declare the asset on one consuming component, regenerate it, and
95
+ confirm its verification report shows a strength score computed by
96
+ the new kind, not by Python's mutation.
97
+
98
+ ## 6. Report
99
+
100
+ Tell the user: the kind and its seven parts in one paragraph each, the
101
+ calibration scores, every environment it adds, the decision id, and what
102
+ you left open. Never report a kind as done while its strength check is
103
+ untested.
104
+
105
+ ## Worked example: `javascript`
106
+
107
+ - Asset: `static/app.js` in `docs-site-renderer`, an ES module whose
108
+ pure functions (`filterNodes(snapshot, query)`, `neighbors(graph,
109
+ id)`) take and return JSON, plus a thin DOM layer that wires them to
110
+ clicks.
111
+ - Wrong versions: a filter that ignores case, a search that misses
112
+ partial matches, a neighbor list that includes the node itself, an
113
+ off-by-one on depth, a click handler bound to the wrong element.
114
+ - Strength: mutation, `D335`'s token swaps over the whole file. The DOM
115
+ layer stays thin and is checked through the rendered HTML; the
116
+ pure functions carry the behaviour and the mutants.
117
+ - Running: `asset_runner("filterNodes", [snapshot, "gen"])` runs
118
+ `node --input-type=module` on a fixed driver that imports the module
119
+ and prints the JSON result.
120
+ - Environment: Node >= 20 and the project's `package-lock.json`,
121
+ provisioned only for projects that declare a `javascript` asset.
@@ -0,0 +1,14 @@
1
+ # AC-SLUG-001
2
+
3
+ Covers: R-SLUG-001
4
+ Kind: generated-test
5
+
6
+ ```gherkin
7
+ Given the title "Hello, World!"
8
+ When slugify(title) is called
9
+ Then it returns "hello-world"
10
+
11
+ Given the title " --Rust & Go: 2 Languages-- "
12
+ When slugify(title) is called
13
+ Then it returns "rust-go-2-languages"
14
+ ```
@@ -0,0 +1,14 @@
1
+ # AC-SLUG-002
2
+
3
+ Covers: R-SLUG-002
4
+ Kind: generated-test
5
+
6
+ ```gherkin
7
+ Given the title "Café Déjà Vu"
8
+ When slugify(title) is called
9
+ Then it returns "cafe-deja-vu"
10
+
11
+ Given the title "Tokyo 日本 Guide"
12
+ When slugify(title) is called
13
+ Then it returns "tokyo-guide"
14
+ ```
@@ -0,0 +1,10 @@
1
+ # AC-SLUG-003
2
+
3
+ Covers: R-SLUG-003
4
+ Kind: generated-test
5
+
6
+ ```gherkin
7
+ Given each of the titles "", " " and "!!!"
8
+ When slugify(title) is called
9
+ Then it raises ValueError whose message contains "empty"
10
+ ```
@@ -0,0 +1,18 @@
1
+ # AC-SLUG-004
2
+
3
+ Covers: R-SLUG-004
4
+ Kind: generated-test
5
+
6
+ ```gherkin
7
+ Given the title "alpha beta gamma"
8
+ When slugify(title, max_length=11) is called
9
+ Then it returns "alpha-beta"
10
+
11
+ Given the title "alpha beta gamma"
12
+ When slugify(title, max_length=80) is called
13
+ Then it returns "alpha-beta-gamma"
14
+
15
+ Given the title "abc"
16
+ When slugify(title, max_length=0) is called
17
+ Then it raises ValueError whose message contains "max_length"
18
+ ```
@@ -0,0 +1,51 @@
1
+ ---
2
+ id: comp-slugify
3
+ title: Slugify
4
+ status: draft
5
+ owners: [web-team]
6
+ depends_on: []
7
+ realizes: [P-SLUGS]
8
+ sealed: false
9
+ ---
10
+
11
+ # Slugify
12
+
13
+ ## Purpose
14
+
15
+ Turns a page title into a URL-safe slug.
16
+
17
+ ## Scope
18
+
19
+ **In scope:** lowercase, hyphen-separated slugs. **Out of scope:** uniqueness.
20
+
21
+ ## Definitions
22
+
23
+ No deltas from `specs/glossary.md`.
24
+
25
+ ## Behavior
26
+
27
+ See `requirements/`.
28
+
29
+ ## Interfaces
30
+
31
+ See `interface/`.
32
+
33
+ ## Data
34
+
35
+ None.
36
+
37
+ ## Acceptance criteria
38
+
39
+ See `acceptance/`.
40
+
41
+ ## Non-functional constraints
42
+
43
+ See `constraints.md`.
44
+
45
+ ## Open questions
46
+
47
+ None.
48
+
49
+ ## Change log
50
+
51
+ - Initial draft.
@@ -0,0 +1,3 @@
1
+ # Slugify — Non-Functional Constraints
2
+
3
+ - **Pure.** No I/O.
@@ -0,0 +1,10 @@
1
+ # Library
2
+
3
+ One module file, `slugify.py`.
4
+
5
+ ```
6
+ slugify(title: str, max_length: int = 80) -> str
7
+ ```
8
+
9
+ Errors: `slugify` raises `ValueError` for an invalid argument, as the
10
+ requirements state; it never returns an empty string.
@@ -0,0 +1,5 @@
1
+ # R-SLUG-001
2
+
3
+ **R-SLUG-001** — `slugify(title)` MUST return the title lowercased, with each run of
4
+ characters other than ASCII letters and digits replaced by a single hyphen, and
5
+ no leading or trailing hyphen.
@@ -0,0 +1,7 @@
1
+ # R-SLUG-002
2
+
3
+ **R-SLUG-002** — Before the R-SLUG-001 rules apply, `slugify` MUST convert
4
+ accented letters to their unaccented ASCII letters by Unicode NFKD
5
+ normalization, dropping the combining marks, so `"Café Déjà Vu"` gives
6
+ `"cafe-deja-vu"`. A character with no ASCII form, such as `"日"`, counts
7
+ as a non-alphanumeric character.
@@ -0,0 +1,5 @@
1
+ # R-SLUG-003
2
+
3
+ **R-SLUG-003** — `slugify` MUST raise `ValueError` with a message
4
+ containing `empty` when the slug the rules above produce would be the
5
+ empty string, such as for `""`, `" "` or `"!!!"`.
@@ -0,0 +1,6 @@
1
+ # R-SLUG-004
2
+
3
+ **R-SLUG-004** — `slugify` MUST return at most `max_length` characters: a
4
+ longer slug is cut to its first `max_length` characters, then any
5
+ trailing hyphen is removed. A `max_length` below `1` MUST raise
6
+ `ValueError` with a message containing `max_length`.
@@ -0,0 +1,22 @@
1
+ ---
2
+ id: P-SLUGS
3
+ title: Titles Become URL Slugs
4
+ status: draft
5
+ owners: [web-team]
6
+ ---
7
+
8
+ # Titles Become URL Slugs
9
+
10
+ ## Purpose
11
+
12
+ A page title can be turned into a URL-safe slug.
13
+
14
+ ### CS-SLUGS-001
15
+ Covers: P-SLUGS
16
+ Kind: generated-test
17
+
18
+ ```gherkin
19
+ Given the title "Hello, World!"
20
+ When it is slugified
21
+ Then the result is "hello-world"
22
+ ```
@@ -0,0 +1,24 @@
1
+ # Generated Code
2
+
3
+ The tool's own components, one directory per component, named by slug
4
+ (`gen/<slug>/`). A project made by `hotdocs init` has its own `gen/` for its
5
+ own components and uses these from the tool's checkout (`D199`).
6
+
7
+ Committed on every branch and never hand-edited: a component is changed by
8
+ editing its spec and running `hotdocs generate`, and the result replaces this
9
+ directory only after every acceptance criterion passes. The two declared
10
+ exemptions, `sealed` components and file-level pinned overrides
11
+ (`.overrides.json`), are in `SPEC_GUIDELINES.md` §8.
12
+
13
+ Five directories are hand-written and tested rather than generated:
14
+ `generator` and `llm-endpoint` (each runs through the other, so neither could
15
+ be generated first) and `spec-linter`, `graph-query-engine` and
16
+ `cache-manager` (built before the generator existed). Everything else here
17
+ was produced by `generator` from its component's spec bundle and verified by
18
+ `verifier-orchestrator`; the manifest in `verification/<slug>/.provenance.json`
19
+ records which spec hash and model produced it.
20
+
21
+ Each component is a flat module file or a package found by path, not an
22
+ installed Python package. `hotdocs-cli` loads a verb's module by file; a
23
+ component loads a dependency from `<repo_root>/gen/<slug>/`, falling back to
24
+ the same path under the tool root.