surfaceplate 0.16.0__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.
- surfaceplate/MANIFEST.sha256 +230 -0
- surfaceplate/VERSION +1 -0
- surfaceplate/__init__.py +18 -0
- surfaceplate/about.py +48 -0
- surfaceplate/adapters/python.md +5 -0
- surfaceplate/adapters/r.md +3 -0
- surfaceplate/adapters/typescript.md +5 -0
- surfaceplate/adopt/__init__.py +15 -0
- surfaceplate/adopt/catalogue.py +78 -0
- surfaceplate/adopt/defaults.py +278 -0
- surfaceplate/adopt/detect.py +141 -0
- surfaceplate/adopt/discover.py +614 -0
- surfaceplate/adopt/example_answers.py +128 -0
- surfaceplate/adopt/explanations.py +551 -0
- surfaceplate/adopt/flow.py +559 -0
- surfaceplate/adopt/interview.py +237 -0
- surfaceplate/adopt/plan.py +1330 -0
- surfaceplate/adopt/provenance.py +300 -0
- surfaceplate/adopt/render.py +282 -0
- surfaceplate/adopt/scaffold.py +343 -0
- surfaceplate/adopt/sections.py +287 -0
- surfaceplate/adopt/tui/__init__.py +7 -0
- surfaceplate/adopt/tui/app.py +211 -0
- surfaceplate/adopt/tui/app.tcss +294 -0
- surfaceplate/adopt/tui/mark.py +77 -0
- surfaceplate/adopt/tui/screens.py +1772 -0
- surfaceplate/adopt/validators.py +224 -0
- surfaceplate/adopt/wizard.py +932 -0
- surfaceplate/check_conformance.py +3664 -0
- surfaceplate/cli.py +268 -0
- surfaceplate/core/AI_OPERATING_MODEL.md +45 -0
- surfaceplate/core/CONFORMANCE_LEVELS.md +299 -0
- surfaceplate/core/CONTROL_PRINCIPLES.md +14 -0
- surfaceplate/core/PREREQUISITE_GATES.md +322 -0
- surfaceplate/core/REVIEW_AND_EVIDENCE.md +55 -0
- surfaceplate/core/SECURITY_BASELINE.md +29 -0
- surfaceplate/doctor.py +249 -0
- surfaceplate/examples/application-profile.essential.example.yaml +126 -0
- surfaceplate/examples/application-profile.full.example.yaml +315 -0
- surfaceplate/examples/method-registry-entry.example.yaml +78 -0
- surfaceplate/examples/method-run-lineage.example.yaml +44 -0
- surfaceplate/examples/override-record.approved.example.yaml +39 -0
- surfaceplate/install_standard.py +880 -0
- surfaceplate/rules.py +148 -0
- surfaceplate/schemas/README.md +24 -0
- surfaceplate/schemas/application-profile.schema.yaml +320 -0
- surfaceplate/schemas/assurance-evidence.schema.yaml +33 -0
- surfaceplate/schemas/gate-exception.schema.yaml +47 -0
- surfaceplate/schemas/method-registry-entry.schema.yaml +132 -0
- surfaceplate/schemas/method-run-lineage.schema.yaml +72 -0
- surfaceplate/schemas/override-record.schema.yaml +76 -0
- surfaceplate/seeds/CHANGELOG.md +18 -0
- surfaceplate/seeds/activity-register.md +47 -0
- surfaceplate/seeds/adoption-decision-record.md +30 -0
- surfaceplate/seeds/data-source-register.md +18 -0
- surfaceplate/seeds/decision-log.md +28 -0
- surfaceplate/seeds/dependency-review-log.md +18 -0
- surfaceplate/seeds/findings-register.md +26 -0
- surfaceplate/seeds/method-registry-readme.md +7 -0
- surfaceplate/seeds/options-log.md +18 -0
- surfaceplate/seeds/output-validation-log.md +18 -0
- surfaceplate/seeds/overrides-readme.md +7 -0
- surfaceplate/seeds/release-checklist.md +19 -0
- surfaceplate/seeds/risk-classification.md +24 -0
- surfaceplate/seeds/run-lineage-readme.md +7 -0
- surfaceplate/seeds/source-of-truth-matrix.yaml +25 -0
- surfaceplate/seeds/test-conventions.md +20 -0
- surfaceplate/standard/.githooks/.gitattributes +1 -0
- surfaceplate/standard/.githooks/pre-commit +35 -0
- surfaceplate/standard/.github/skills/bug-fix/SKILL.md +57 -0
- surfaceplate/standard/.github/skills/change/SKILL.md +62 -0
- surfaceplate/standard/.github/skills/dependency-update/SKILL.md +61 -0
- surfaceplate/standard/.github/skills/fix-ci/SKILL.md +68 -0
- surfaceplate/standard/.github/skills/release/SKILL.md +71 -0
- surfaceplate/standard/.github/skills/review/SKILL.md +56 -0
- surfaceplate/standard/.github/skills/security-review/SKILL.md +61 -0
- surfaceplate/standard/.github/workflows/standards-conformance.yml +38 -0
- surfaceplate/standard/agent-instructions/activity.md +78 -0
- surfaceplate/standard/agent-instructions/ai-workflow.md +109 -0
- surfaceplate/standard/agent-instructions/authority.md +72 -0
- surfaceplate/standard/agent-instructions/provenance.md +93 -0
- surfaceplate/standard/agent-instructions/security.md +78 -0
- surfaceplate/standard/agent-instructions/tests.md +71 -0
- surfaceplate/standard/conformance-block.md +31 -0
- surfaceplate/templates/application-profile.yaml +113 -0
- surfaceplate/templates/decision-record.md +42 -0
- surfaceplate/templates/gate-exception.yaml +23 -0
- surfaceplate/templates/override-record.yaml +25 -0
- surfaceplate/templates/work-packet.md +33 -0
- surfaceplate-0.16.0.dist-info/METADATA +19 -0
- surfaceplate-0.16.0.dist-info/RECORD +96 -0
- surfaceplate-0.16.0.dist-info/WHEEL +4 -0
- surfaceplate-0.16.0.dist-info/entry_points.txt +2 -0
- surfaceplate-0.16.0.dist-info/licenses/LICENSE +201 -0
- surfaceplate-0.16.0.dist-info/licenses/LICENSE-DOCS +121 -0
- surfaceplate-0.16.0.dist-info/licenses/NOTICE +24 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"""Recognition-over-recall defaults for rationale fields: a real example to react to, not a blank
|
|
2
|
+
box to stare at.
|
|
3
|
+
|
|
4
|
+
`DR-35` records the design principle: every rationale field a real adopter answers offers an
|
|
5
|
+
editable example, shown as the prompt's `default=` - the same "shown, must be explicitly
|
|
6
|
+
submitted" pattern `review_by` and `enforcement` already use elsewhere in this wizard. Accepting a
|
|
7
|
+
default is still answering; nothing here is written unless a human's actual keystroke (even just
|
|
8
|
+
Enter) submits it.
|
|
9
|
+
|
|
10
|
+
Sourced, not invented: every string below is drawn from `examples/application-profile.essential
|
|
11
|
+
.example.yaml` or `examples/application-profile.full.example.yaml` - this framework's own two
|
|
12
|
+
worked, schema-valid example profiles - or, where those don't cover an item, composed directly
|
|
13
|
+
from that item's own rule text in `core/PREREQUISITE_GATES.md`.
|
|
14
|
+
|
|
15
|
+
**Deliberately scoped, not complete over every field.** Only rationale fields get an example - not
|
|
16
|
+
a gate's precondition artefact, gated paths, or effective date, which are too repository-specific
|
|
17
|
+
to usefully example and where a plausible-looking example risks being copied unedited. Within
|
|
18
|
+
rationale fields, only items whose rationale prompt is genuinely reachable get an entry here:
|
|
19
|
+
|
|
20
|
+
- The three baseline controls and the nine conformance-level controls: every one is covered, since
|
|
21
|
+
`ask_controls` always asks a rationale for each.
|
|
22
|
+
- Of the nineteen gates, only the eleven whose `required`/`deferred`/`not_applicable` choice is
|
|
23
|
+
ever actually asked. `work_registration`, `authority_map`, `decision_before_implementation`, and
|
|
24
|
+
`change_record_before_completion` are mandatory `required` at every level that asks about them at
|
|
25
|
+
all (`sections.py`'s `_ask_one_gate` skips the choice entirely when `mandatory=True`), and the
|
|
26
|
+
four interface gates (`catalogue.DESIGN_GATES`) are either forced `required` (a UI-building
|
|
27
|
+
repository) or auto-filled `not_applicable` with their own existing default (a repository with no
|
|
28
|
+
UI) before `_ask_one_gate` is ever reached for them. None of those eight ever shows the
|
|
29
|
+
`not_applicable`/`deferred` rationale prompt this module's gate examples are for.
|
|
30
|
+
`tests/test_adopt.py` derives this eleven-gate set the same way `sections.py` itself decides
|
|
31
|
+
which gates are optional - `GATE_CATALOGUE` minus `DESIGN_GATES` minus
|
|
32
|
+
`LEVEL_REQUIRED_GATES["standard"]` - rather than a hand-copied list, so it cannot silently drift
|
|
33
|
+
from what the wizard actually asks.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
from __future__ import annotations
|
|
37
|
+
|
|
38
|
+
# --- Baseline controls (all three; always asked) -----------------------------------------------
|
|
39
|
+
# Sourced from application-profile.essential.example.yaml, which states each in its punchiest form.
|
|
40
|
+
|
|
41
|
+
_BASELINE_CONTROL_RATIONALE: dict[str, str] = {
|
|
42
|
+
"agent_work_packets": "All agent work is bounded, scoped, and reviewable.",
|
|
43
|
+
"actual_diff_review": "Material changes require actual diff content, not a file list.",
|
|
44
|
+
"secret_hygiene": "No secrets or customer data may enter the repository or fixtures.",
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# --- Conformance-level controls (all nine; always asked when required at the chosen level) ------
|
|
48
|
+
# Sourced from application-profile.full.example.yaml (essential.example.yaml for dependency_lock,
|
|
49
|
+
# which full.example.yaml does not declare at all - full already exceeds essential's own floor).
|
|
50
|
+
|
|
51
|
+
_LEVEL_CONTROL_RATIONALE: dict[str, str] = {
|
|
52
|
+
"dependency_lock": "Supply-chain exposure exists regardless of output materiality.",
|
|
53
|
+
"deterministic_tests": "Outputs must be reproducible before they can be reviewed.",
|
|
54
|
+
"contract_tests": "The API is consumed by a separate frontend and would break silently.",
|
|
55
|
+
"documentation_authority": "Contradictory specification authority is treated as a blocking defect.",
|
|
56
|
+
"provenance": "Every material figure must be traceable to its inputs and parameter version.",
|
|
57
|
+
"run_lineage": "Material calculations must be reproducible from a recorded execution.",
|
|
58
|
+
"method_registry": "Governed rules carry lifecycle, validation, and approval state.",
|
|
59
|
+
"overrides": "A manual adjustment must never be hidden in calculation code.",
|
|
60
|
+
"assurance_findings": "Limitations are recorded rather than smoothed away.",
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# --- Gates whose status is ever a genuine choice (eleven of nineteen; see module docstring) ------
|
|
64
|
+
# Composed from each gate's own rule text and group description in core/PREREQUISITE_GATES.md,
|
|
65
|
+
# phrased as a plausible not_applicable-leaning rationale an early-stage adopter might actually
|
|
66
|
+
# give - editable, and deliberately not phrased as an endorsement that the reasoning is sound for
|
|
67
|
+
# every repository.
|
|
68
|
+
|
|
69
|
+
_GATE_RATIONALE: dict[str, str] = {
|
|
70
|
+
"work_contract": (
|
|
71
|
+
"No AI-assisted implementation happens in this repository yet; every change is made by a "
|
|
72
|
+
"human contributor directly."
|
|
73
|
+
),
|
|
74
|
+
"risk_classification": (
|
|
75
|
+
"Risk classification is not yet a formal step in this repository's workflow; changes are "
|
|
76
|
+
"reviewed informally through code review today."
|
|
77
|
+
),
|
|
78
|
+
"register_currency": (
|
|
79
|
+
"This repository's work register is small enough to check manually at each handover; no "
|
|
80
|
+
"generated view exists yet to gate against."
|
|
81
|
+
),
|
|
82
|
+
"test_convention": (
|
|
83
|
+
"No formal, written test-naming or location convention exists yet; tests are added ad hoc "
|
|
84
|
+
"and their placement is reviewed in code review."
|
|
85
|
+
),
|
|
86
|
+
"authority_same_change": (
|
|
87
|
+
"This repository has no authority_map gate declared, so there is no controlling document "
|
|
88
|
+
"for a change to keep in step with yet."
|
|
89
|
+
),
|
|
90
|
+
"regression_before_merge": (
|
|
91
|
+
"No logic in this repository is critical enough yet to name a dedicated regression suite; "
|
|
92
|
+
"ordinary test coverage runs on every change instead."
|
|
93
|
+
),
|
|
94
|
+
"equivalence_evidence": (
|
|
95
|
+
"This repository has not yet made a performance or refactoring change on a critical path; "
|
|
96
|
+
"nothing has needed equivalence evidence so far."
|
|
97
|
+
),
|
|
98
|
+
"data_source_lifecycle": (
|
|
99
|
+
"This repository selects from a fixed, small set of data sources chosen at build time; "
|
|
100
|
+
"there is no runtime selection step for this gate to guard."
|
|
101
|
+
),
|
|
102
|
+
"output_validation_before_external_use": (
|
|
103
|
+
"Nothing this repository generates leaves the delivery team today; outputs are consumed "
|
|
104
|
+
"only by the team that produced them."
|
|
105
|
+
),
|
|
106
|
+
"dependency_output_delta": (
|
|
107
|
+
"This repository's dependencies do not influence its output - they support the build and "
|
|
108
|
+
"test process only."
|
|
109
|
+
),
|
|
110
|
+
"records_before_release": (
|
|
111
|
+
"This repository has not yet prepared a release; there is no release process for this gate "
|
|
112
|
+
"to guard yet."
|
|
113
|
+
),
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
RATIONALE_EXAMPLES: dict[str, str] = {
|
|
117
|
+
**_BASELINE_CONTROL_RATIONALE,
|
|
118
|
+
**_LEVEL_CONTROL_RATIONALE,
|
|
119
|
+
**_GATE_RATIONALE,
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def rationale_example(item_id: str) -> str:
|
|
124
|
+
"""The example rationale for `item_id`, or `""` if none exists - the same "no default" shape
|
|
125
|
+
`_nonempty_text`'s own `default=""` already uses everywhere this module doesn't apply. Never
|
|
126
|
+
raises: unlike `explanations.explain`, an absent example is an expected, scoped state for the
|
|
127
|
+
eight gates the module docstring names, not a coverage gap."""
|
|
128
|
+
return RATIONALE_EXAMPLES.get(item_id, "")
|