@ahmed-g-gad/apothem 0.1.1
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.
- package/CHANGELOG.md +60 -0
- package/LICENSE +21 -0
- package/LICENSES/MIT.txt +18 -0
- package/LICENSES/PSF-2.0.txt +47 -0
- package/README.md +549 -0
- package/bin/README.md +37 -0
- package/bin/apothem.mjs +78 -0
- package/package.json +75 -0
- package/pyproject.toml +347 -0
- package/src/apothem/README.md +52 -0
- package/src/apothem/__init__.py +66 -0
- package/src/apothem/__main__.py +28 -0
- package/src/apothem/_vendor/.keep +0 -0
- package/src/apothem/_vendor/__init__.py +25 -0
- package/src/apothem/_vendor/attr/__init__.py +104 -0
- package/src/apothem/_vendor/attr/__init__.pyi +389 -0
- package/src/apothem/_vendor/attr/_cmp.py +160 -0
- package/src/apothem/_vendor/attr/_cmp.pyi +13 -0
- package/src/apothem/_vendor/attr/_compat.py +99 -0
- package/src/apothem/_vendor/attr/_config.py +31 -0
- package/src/apothem/_vendor/attr/_funcs.py +497 -0
- package/src/apothem/_vendor/attr/_make.py +3406 -0
- package/src/apothem/_vendor/attr/_next_gen.py +674 -0
- package/src/apothem/_vendor/attr/_typing_compat.pyi +15 -0
- package/src/apothem/_vendor/attr/_version_info.py +89 -0
- package/src/apothem/_vendor/attr/_version_info.pyi +9 -0
- package/src/apothem/_vendor/attr/converters.py +162 -0
- package/src/apothem/_vendor/attr/converters.pyi +19 -0
- package/src/apothem/_vendor/attr/exceptions.py +95 -0
- package/src/apothem/_vendor/attr/exceptions.pyi +17 -0
- package/src/apothem/_vendor/attr/filters.py +72 -0
- package/src/apothem/_vendor/attr/filters.pyi +6 -0
- package/src/apothem/_vendor/attr/py.typed +0 -0
- package/src/apothem/_vendor/attr/setters.py +79 -0
- package/src/apothem/_vendor/attr/setters.pyi +20 -0
- package/src/apothem/_vendor/attr/validators.py +750 -0
- package/src/apothem/_vendor/attr/validators.pyi +140 -0
- package/src/apothem/_vendor/attr.LICENSE +21 -0
- package/src/apothem/_vendor/attrs/__init__.py +72 -0
- package/src/apothem/_vendor/attrs/__init__.pyi +314 -0
- package/src/apothem/_vendor/attrs/converters.py +3 -0
- package/src/apothem/_vendor/attrs/exceptions.py +3 -0
- package/src/apothem/_vendor/attrs/filters.py +3 -0
- package/src/apothem/_vendor/attrs/py.typed +0 -0
- package/src/apothem/_vendor/attrs/setters.py +3 -0
- package/src/apothem/_vendor/attrs/validators.py +3 -0
- package/src/apothem/_vendor/attrs.LICENSE +21 -0
- package/src/apothem/_vendor/jsonschema/__init__.py +120 -0
- package/src/apothem/_vendor/jsonschema/__main__.py +6 -0
- package/src/apothem/_vendor/jsonschema/_format.py +546 -0
- package/src/apothem/_vendor/jsonschema/_keywords.py +449 -0
- package/src/apothem/_vendor/jsonschema/_legacy_keywords.py +449 -0
- package/src/apothem/_vendor/jsonschema/_types.py +204 -0
- package/src/apothem/_vendor/jsonschema/_typing.py +29 -0
- package/src/apothem/_vendor/jsonschema/_utils.py +355 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/__init__.py +5 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/const_vs_enum.py +30 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/contains.py +28 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/import_benchmark.py +31 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/issue232/issue.json +2653 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/issue232.py +25 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/json_schema_test_suite.py +12 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/nested_schemas.py +56 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/subcomponents.py +42 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/unused_registry.py +35 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/useless_applicator_schemas.py +106 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/useless_keywords.py +32 -0
- package/src/apothem/_vendor/jsonschema/benchmarks/validator_creation.py +14 -0
- package/src/apothem/_vendor/jsonschema/cli.py +292 -0
- package/src/apothem/_vendor/jsonschema/exceptions.py +490 -0
- package/src/apothem/_vendor/jsonschema/protocols.py +230 -0
- package/src/apothem/_vendor/jsonschema/validators.py +1410 -0
- package/src/apothem/_vendor/jsonschema.LICENSE +19 -0
- package/src/apothem/_vendor/jsonschema_specifications/__init__.py +12 -0
- package/src/apothem/_vendor/jsonschema_specifications/_core.py +38 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/metaschema.json +42 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/applicator +56 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/content +17 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/core +57 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/format +14 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/meta-data +37 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/validation +98 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/metaschema.json +58 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/applicator +48 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/content +17 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/core +51 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/format-annotation +14 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/format-assertion +14 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/meta-data +37 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/unevaluated +15 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/validation +98 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft3/metaschema.json +172 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft4/metaschema.json +149 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft6/metaschema.json +153 -0
- package/src/apothem/_vendor/jsonschema_specifications/schemas/draft7/metaschema.json +166 -0
- package/src/apothem/_vendor/jsonschema_specifications.LICENSE +19 -0
- package/src/apothem/_vendor/referencing/__init__.py +7 -0
- package/src/apothem/_vendor/referencing/_attrs.py +31 -0
- package/src/apothem/_vendor/referencing/_attrs.pyi +21 -0
- package/src/apothem/_vendor/referencing/_core.py +739 -0
- package/src/apothem/_vendor/referencing/exceptions.py +165 -0
- package/src/apothem/_vendor/referencing/jsonschema.py +642 -0
- package/src/apothem/_vendor/referencing/py.typed +0 -0
- package/src/apothem/_vendor/referencing/retrieval.py +94 -0
- package/src/apothem/_vendor/referencing/typing.py +61 -0
- package/src/apothem/_vendor/referencing.LICENSE +19 -0
- package/src/apothem/_vendor/rpds/__init__.py +251 -0
- package/src/apothem/_vendor/typing_extensions.LICENSE +279 -0
- package/src/apothem/_vendor/typing_extensions.py +4317 -0
- package/src/apothem/_vendor/vendor.txt +22 -0
- package/src/apothem/_vendor/yaml/__init__.py +389 -0
- package/src/apothem/_vendor/yaml/composer.py +138 -0
- package/src/apothem/_vendor/yaml/constructor.py +748 -0
- package/src/apothem/_vendor/yaml/cyaml.py +100 -0
- package/src/apothem/_vendor/yaml/dumper.py +61 -0
- package/src/apothem/_vendor/yaml/emitter.py +1137 -0
- package/src/apothem/_vendor/yaml/error.py +74 -0
- package/src/apothem/_vendor/yaml/events.py +85 -0
- package/src/apothem/_vendor/yaml/loader.py +63 -0
- package/src/apothem/_vendor/yaml/nodes.py +48 -0
- package/src/apothem/_vendor/yaml/parser.py +588 -0
- package/src/apothem/_vendor/yaml/reader.py +185 -0
- package/src/apothem/_vendor/yaml/representer.py +388 -0
- package/src/apothem/_vendor/yaml/resolver.py +226 -0
- package/src/apothem/_vendor/yaml/scanner.py +1435 -0
- package/src/apothem/_vendor/yaml/serializer.py +110 -0
- package/src/apothem/_vendor/yaml/tokens.py +103 -0
- package/src/apothem/_vendor/yaml.LICENSE +20 -0
- package/src/apothem/agents/README.md +60 -0
- package/src/apothem/agents/codebase-explorer.md +91 -0
- package/src/apothem/agents/convention-auditor.md +93 -0
- package/src/apothem/agents/dependency-auditor.md +97 -0
- package/src/apothem/agents/fact-checker.md +84 -0
- package/src/apothem/agents/mcp-builder.md +86 -0
- package/src/apothem/agents/memory-auditor.md +93 -0
- package/src/apothem/agents/prompt-evaluator.md +87 -0
- package/src/apothem/agents/quality-gate.md +103 -0
- package/src/apothem/agents/refactor-surgeon.md +74 -0
- package/src/apothem/agents/research-scout.md +73 -0
- package/src/apothem/agents/security-scanner.md +83 -0
- package/src/apothem/agents/test-runner.md +84 -0
- package/src/apothem/audit/README.md +73 -0
- package/src/apothem/audit/_scan_lib.py +182 -0
- package/src/apothem/audit/analyze_graph.py +260 -0
- package/src/apothem/audit/build_capability_graph.py +607 -0
- package/src/apothem/audit/build_inventory.py +657 -0
- package/src/apothem/audit/build_plans_provenance.py +997 -0
- package/src/apothem/audit/check_links.py +389 -0
- package/src/apothem/audit/classify_artifacts.py +381 -0
- package/src/apothem/audit/deprecated-tokens.txt +10 -0
- package/src/apothem/audit/execute_plans_migration.py +491 -0
- package/src/apothem/audit/known-projects.txt +15 -0
- package/src/apothem/audit/render_capability_index.py +467 -0
- package/src/apothem/audit/render_inventory.py +405 -0
- package/src/apothem/audit/scan_ai_surfaces.py +1125 -0
- package/src/apothem/audit/scan_ai_surfaces_coarse.py +261 -0
- package/src/apothem/audit/scan_drift_features.py +143 -0
- package/src/apothem/audit/scan_frontmatter.py +293 -0
- package/src/apothem/audit/scan_header_coverage.py +1134 -0
- package/src/apothem/audit/scan_plan_leakage.py +540 -0
- package/src/apothem/audit/scan_plans_discipline.py +188 -0
- package/src/apothem/audit/scan_secrets_pii.py +245 -0
- package/src/apothem/audit/scan_stale_tokens.py +296 -0
- package/src/apothem/audit/synthesize_drift.py +205 -0
- package/src/apothem/benchmarks/README.md +33 -0
- package/src/apothem/benchmarks/__init__.py +3 -0
- package/src/apothem/benchmarks/bench_agents.py +63 -0
- package/src/apothem/benchmarks/bench_hooks.py +93 -0
- package/src/apothem/benchmarks/bench_install.py +58 -0
- package/src/apothem/benchmarks/bench_tests.py +93 -0
- package/src/apothem/benchmarks/bench_validate_ecosystem.py +84 -0
- package/src/apothem/cli/README.md +33 -0
- package/src/apothem/cli/__init__.py +229 -0
- package/src/apothem/cli/_cmd_completion.py +88 -0
- package/src/apothem/cli/_cmd_diff.py +181 -0
- package/src/apothem/cli/_cmd_doctor.py +143 -0
- package/src/apothem/cli/_cmd_harnesses.py +167 -0
- package/src/apothem/cli/_cmd_install.py +327 -0
- package/src/apothem/cli/_cmd_migrate_workspace.py +143 -0
- package/src/apothem/cli/_cmd_profile.py +341 -0
- package/src/apothem/cli/_cmd_status.py +180 -0
- package/src/apothem/cli/_cmd_uninstall.py +215 -0
- package/src/apothem/cli/_cmd_update.py +397 -0
- package/src/apothem/cli/_cmd_verify.py +194 -0
- package/src/apothem/cli/_common_flags.py +90 -0
- package/src/apothem/cli/_epilogs.py +296 -0
- package/src/apothem/cli/_helpers.py +857 -0
- package/src/apothem/cli/_json_formatter.py +21 -0
- package/src/apothem/cli/_materialize.py +376 -0
- package/src/apothem/cli/completions/apothem.bash +30 -0
- package/src/apothem/cli/completions/apothem.fish +19 -0
- package/src/apothem/cli/completions/apothem.ps1 +27 -0
- package/src/apothem/cli/completions/apothem.zsh +42 -0
- package/src/apothem/cli/reference_export.py +126 -0
- package/src/apothem/commands/README.md +125 -0
- package/src/apothem/commands/a11y-audit.md +203 -0
- package/src/apothem/commands/architecture-review.md +194 -0
- package/src/apothem/commands/audit.md +165 -0
- package/src/apothem/commands/code-audit.md +218 -0
- package/src/apothem/commands/code-review.md +193 -0
- package/src/apothem/commands/dependency-audit.md +209 -0
- package/src/apothem/commands/docs-review.md +199 -0
- package/src/apothem/commands/elevate.md +285 -0
- package/src/apothem/commands/eval.md +149 -0
- package/src/apothem/commands/fortress.md +172 -0
- package/src/apothem/commands/freshify.md +168 -0
- package/src/apothem/commands/github-deploy-fresh.md +178 -0
- package/src/apothem/commands/github-deploy-next.md +167 -0
- package/src/apothem/commands/perf-audit.md +198 -0
- package/src/apothem/commands/plan-amend.md +104 -0
- package/src/apothem/commands/plan-audit.md +127 -0
- package/src/apothem/commands/plan-design.md +257 -0
- package/src/apothem/commands/plan-execute.md +495 -0
- package/src/apothem/commands/plan-generate.md +351 -0
- package/src/apothem/commands/plan-review.md +555 -0
- package/src/apothem/commands/plan-spec.md +359 -0
- package/src/apothem/commands/plan-status.md +222 -0
- package/src/apothem/commands/plan.md +173 -0
- package/src/apothem/commands/projectify.md +142 -0
- package/src/apothem/commands/release-readiness.md +142 -0
- package/src/apothem/commands/research-analysis.md +241 -0
- package/src/apothem/commands/research-design.md +231 -0
- package/src/apothem/commands/research-disseminate.md +225 -0
- package/src/apothem/commands/research-experiment.md +232 -0
- package/src/apothem/commands/research-ideate.md +213 -0
- package/src/apothem/commands/research-paper.md +252 -0
- package/src/apothem/commands/research-proposal.md +220 -0
- package/src/apothem/commands/research-publish.md +255 -0
- package/src/apothem/commands/research-review.md +251 -0
- package/src/apothem/commands/research-sources.md +266 -0
- package/src/apothem/commands/research-spec.md +255 -0
- package/src/apothem/commands/research-synthesis.md +233 -0
- package/src/apothem/commands/research-theory.md +218 -0
- package/src/apothem/commands/research.md +181 -0
- package/src/apothem/commands/security-audit.md +196 -0
- package/src/apothem/commands/supply-chain-audit.md +192 -0
- package/src/apothem/commands/test-suite.md +146 -0
- package/src/apothem/commands/threat-model-audit.md +199 -0
- package/src/apothem/commands/ux-review.md +202 -0
- package/src/apothem/commands/workflow.md +162 -0
- package/src/apothem/conformity/README.md +173 -0
- package/src/apothem/conformity/__init__.py +1 -0
- package/src/apothem/conformity/_grep_base.py +93 -0
- package/src/apothem/conformity/agent_capability_grep.py +306 -0
- package/src/apothem/conformity/agents_md_coverage_grep.py +382 -0
- package/src/apothem/conformity/agnosticism_grep.py +311 -0
- package/src/apothem/conformity/always_on_budget_grep.py +318 -0
- package/src/apothem/conformity/bare_except_grep.py +115 -0
- package/src/apothem/conformity/binding_reciprocity_grep.py +151 -0
- package/src/apothem/conformity/brand_mark_grep.py +272 -0
- package/src/apothem/conformity/commented_out_code_grep.py +176 -0
- package/src/apothem/conformity/completion_claim_grep.py +169 -0
- package/src/apothem/conformity/conventional_commit_grep.py +319 -0
- package/src/apothem/conformity/copilot_instructions_presence_grep.py +324 -0
- package/src/apothem/conformity/cross_platform_matrix_grep.py +297 -0
- package/src/apothem/conformity/determinism_grep.py +306 -0
- package/src/apothem/conformity/diagram_staleness_grep.py +154 -0
- package/src/apothem/conformity/dynamism_grep.py +284 -0
- package/src/apothem/conformity/editorconfig_presence_grep.py +281 -0
- package/src/apothem/conformity/file_header_grep.py +502 -0
- package/src/apothem/conformity/freshness_token_grep.py +233 -0
- package/src/apothem/conformity/frontmatter_grep.py +274 -0
- package/src/apothem/conformity/frontmatter_value_grep.py +386 -0
- package/src/apothem/conformity/gate.py +1386 -0
- package/src/apothem/conformity/gitattributes_presence_grep.py +238 -0
- package/src/apothem/conformity/harden_runner_grep.py +320 -0
- package/src/apothem/conformity/hedging_grep.py +129 -0
- package/src/apothem/conformity/license_author_consistency_grep.py +204 -0
- package/src/apothem/conformity/link_check.py +327 -0
- package/src/apothem/conformity/magic_number_grep.py +182 -0
- package/src/apothem/conformity/multi_surface_coherence_grep.py +620 -0
- package/src/apothem/conformity/naming_grep.py +224 -0
- package/src/apothem/conformity/no_global_plans_grep.py +339 -0
- package/src/apothem/conformity/no_toplevel_docs_grep.py +120 -0
- package/src/apothem/conformity/oidc_trusted_publishing_grep.py +291 -0
- package/src/apothem/conformity/option_annotation_grep.py +352 -0
- package/src/apothem/conformity/orphan_output_grep.py +206 -0
- package/src/apothem/conformity/permissions_minimum_scope_grep.py +299 -0
- package/src/apothem/conformity/plain_language_grep.py +559 -0
- package/src/apothem/conformity/plan_next_step_consistency_grep.py +450 -0
- package/src/apothem/conformity/plan_suite_structure_grep.py +534 -0
- package/src/apothem/conformity/plans_discipline_language_grep.py +245 -0
- package/src/apothem/conformity/production_ready_pr_grep.py +200 -0
- package/src/apothem/conformity/recommend_next_step_grep.py +250 -0
- package/src/apothem/conformity/redundancy_grep.py +401 -0
- package/src/apothem/conformity/reference_token_grep.py +230 -0
- package/src/apothem/conformity/registry_capability_consistency_grep.py +368 -0
- package/src/apothem/conformity/secret_leak_grep.py +193 -0
- package/src/apothem/conformity/semver_stability_grep.py +358 -0
- package/src/apothem/conformity/smoke_install_grep.py +194 -0
- package/src/apothem/conformity/static_version_grep.py +284 -0
- package/src/apothem/conformity/token_efficiency_grep.py +185 -0
- package/src/apothem/conformity/unpinned_action_grep.py +115 -0
- package/src/apothem/conformity/user_confirm_grep.py +74 -0
- package/src/apothem/conformity/workflow_concurrency_grep.py +283 -0
- package/src/apothem/harnesses/README.md +63 -0
- package/src/apothem/harnesses/__init__.py +16 -0
- package/src/apothem/harnesses/_shared/README.md +36 -0
- package/src/apothem/harnesses/_shared/__init__.py +12 -0
- package/src/apothem/harnesses/_shared/install_driver.py +281 -0
- package/src/apothem/harnesses/_shared/install_driver_apply.py +612 -0
- package/src/apothem/harnesses/_shared/install_driver_backup.py +535 -0
- package/src/apothem/harnesses/_shared/install_driver_converters.py +310 -0
- package/src/apothem/harnesses/_shared/install_driver_lifecycle.py +495 -0
- package/src/apothem/harnesses/_shared/install_driver_materialize.py +675 -0
- package/src/apothem/harnesses/_shared/install_driver_merge.py +656 -0
- package/src/apothem/harnesses/_shared/install_driver_pathsafety.py +137 -0
- package/src/apothem/harnesses/_shared/install_driver_planvalidation.py +240 -0
- package/src/apothem/harnesses/_shared/install_driver_removal.py +366 -0
- package/src/apothem/harnesses/_shared/install_driver_treeops.py +248 -0
- package/src/apothem/harnesses/_shared/install_driver_types.py +330 -0
- package/src/apothem/harnesses/_shared/wrapper_factories.py +448 -0
- package/src/apothem/harnesses/antigravity/STANDARD-CONVENTION-PIN.md +91 -0
- package/src/apothem/harnesses/antigravity/__init__.py +70 -0
- package/src/apothem/harnesses/antigravity/capabilities.yml +40 -0
- package/src/apothem/harnesses/antigravity/install.py +63 -0
- package/src/apothem/harnesses/antigravity/templates/GEMINI.md +40 -0
- package/src/apothem/harnesses/antigravity/templates/plugin.json +5 -0
- package/src/apothem/harnesses/antigravity/uninstall.py +22 -0
- package/src/apothem/harnesses/antigravity/update.py +10 -0
- package/src/apothem/harnesses/antigravity/verify.py +11 -0
- package/src/apothem/harnesses/claude_code/STANDARD-CONVENTION-PIN.md +65 -0
- package/src/apothem/harnesses/claude_code/__init__.py +107 -0
- package/src/apothem/harnesses/claude_code/capabilities.yml +42 -0
- package/src/apothem/harnesses/claude_code/install.py +147 -0
- package/src/apothem/harnesses/claude_code/templates/settings.json +351 -0
- package/src/apothem/harnesses/claude_code/uninstall.py +23 -0
- package/src/apothem/harnesses/claude_code/update.py +10 -0
- package/src/apothem/harnesses/claude_code/verify.py +11 -0
- package/src/apothem/harnesses/codebuddy/STANDARD-CONVENTION-PIN.md +74 -0
- package/src/apothem/harnesses/codebuddy/__init__.py +49 -0
- package/src/apothem/harnesses/codebuddy/capabilities.yml +34 -0
- package/src/apothem/harnesses/codebuddy/install.py +40 -0
- package/src/apothem/harnesses/codebuddy/templates/apothem-rules.md +37 -0
- package/src/apothem/harnesses/codebuddy/uninstall.py +25 -0
- package/src/apothem/harnesses/codebuddy/update.py +10 -0
- package/src/apothem/harnesses/codebuddy/verify.py +11 -0
- package/src/apothem/harnesses/codex/STANDARD-CONVENTION-PIN.md +79 -0
- package/src/apothem/harnesses/codex/__init__.py +72 -0
- package/src/apothem/harnesses/codex/capabilities.yml +40 -0
- package/src/apothem/harnesses/codex/install.py +69 -0
- package/src/apothem/harnesses/codex/templates/AGENTS.md +40 -0
- package/src/apothem/harnesses/codex/templates/hooks.json +127 -0
- package/src/apothem/harnesses/codex/uninstall.py +23 -0
- package/src/apothem/harnesses/codex/update.py +10 -0
- package/src/apothem/harnesses/codex/verify.py +11 -0
- package/src/apothem/harnesses/cursor/STANDARD-CONVENTION-PIN.md +79 -0
- package/src/apothem/harnesses/cursor/__init__.py +48 -0
- package/src/apothem/harnesses/cursor/capabilities.yml +42 -0
- package/src/apothem/harnesses/cursor/install.py +38 -0
- package/src/apothem/harnesses/cursor/templates/apothem-rules.mdc +40 -0
- package/src/apothem/harnesses/cursor/uninstall.py +25 -0
- package/src/apothem/harnesses/cursor/update.py +10 -0
- package/src/apothem/harnesses/cursor/verify.py +11 -0
- package/src/apothem/harnesses/gemini_cli/STANDARD-CONVENTION-PIN.md +102 -0
- package/src/apothem/harnesses/gemini_cli/__init__.py +52 -0
- package/src/apothem/harnesses/gemini_cli/capabilities.yml +43 -0
- package/src/apothem/harnesses/gemini_cli/install.py +43 -0
- package/src/apothem/harnesses/gemini_cli/templates/GEMINI.md +38 -0
- package/src/apothem/harnesses/gemini_cli/uninstall.py +25 -0
- package/src/apothem/harnesses/gemini_cli/update.py +10 -0
- package/src/apothem/harnesses/gemini_cli/verify.py +11 -0
- package/src/apothem/harnesses/github_copilot/STANDARD-CONVENTION-PIN.md +84 -0
- package/src/apothem/harnesses/github_copilot/__init__.py +47 -0
- package/src/apothem/harnesses/github_copilot/capabilities.yml +42 -0
- package/src/apothem/harnesses/github_copilot/install.py +40 -0
- package/src/apothem/harnesses/github_copilot/templates/copilot-instructions.md +33 -0
- package/src/apothem/harnesses/github_copilot/uninstall.py +25 -0
- package/src/apothem/harnesses/github_copilot/update.py +10 -0
- package/src/apothem/harnesses/github_copilot/verify.py +11 -0
- package/src/apothem/harnesses/glm/STANDARD-CONVENTION-PIN.md +77 -0
- package/src/apothem/harnesses/glm/__init__.py +56 -0
- package/src/apothem/harnesses/glm/capabilities.yml +33 -0
- package/src/apothem/harnesses/glm/install.py +45 -0
- package/src/apothem/harnesses/glm/templates/glm.toml +58 -0
- package/src/apothem/harnesses/glm/uninstall.py +25 -0
- package/src/apothem/harnesses/glm/update.py +10 -0
- package/src/apothem/harnesses/glm/verify.py +11 -0
- package/src/apothem/harnesses/hermes/STANDARD-CONVENTION-PIN.md +57 -0
- package/src/apothem/harnesses/hermes/__init__.py +33 -0
- package/src/apothem/harnesses/hermes/capabilities.yml +36 -0
- package/src/apothem/harnesses/hermes/install.py +17 -0
- package/src/apothem/harnesses/hermes/materializer.py +35 -0
- package/src/apothem/harnesses/hermes/uninstall.py +33 -0
- package/src/apothem/harnesses/hermes/update.py +10 -0
- package/src/apothem/harnesses/hermes/verify.py +11 -0
- package/src/apothem/harnesses/kimi_code/STANDARD-CONVENTION-PIN.md +128 -0
- package/src/apothem/harnesses/kimi_code/__init__.py +59 -0
- package/src/apothem/harnesses/kimi_code/capabilities.yml +40 -0
- package/src/apothem/harnesses/kimi_code/install.py +42 -0
- package/src/apothem/harnesses/kimi_code/templates/AGENTS.md +43 -0
- package/src/apothem/harnesses/kimi_code/uninstall.py +27 -0
- package/src/apothem/harnesses/kimi_code/update.py +10 -0
- package/src/apothem/harnesses/kimi_code/verify.py +11 -0
- package/src/apothem/harnesses/kiro/STANDARD-CONVENTION-PIN.md +77 -0
- package/src/apothem/harnesses/kiro/__init__.py +49 -0
- package/src/apothem/harnesses/kiro/capabilities.yml +36 -0
- package/src/apothem/harnesses/kiro/install.py +39 -0
- package/src/apothem/harnesses/kiro/templates/apothem-rules.md +36 -0
- package/src/apothem/harnesses/kiro/uninstall.py +25 -0
- package/src/apothem/harnesses/kiro/update.py +10 -0
- package/src/apothem/harnesses/kiro/verify.py +11 -0
- package/src/apothem/harnesses/open_claw/STANDARD-CONVENTION-PIN.md +62 -0
- package/src/apothem/harnesses/open_claw/__init__.py +35 -0
- package/src/apothem/harnesses/open_claw/capabilities.yml +35 -0
- package/src/apothem/harnesses/open_claw/install.py +17 -0
- package/src/apothem/harnesses/open_claw/materializer.py +36 -0
- package/src/apothem/harnesses/open_claw/uninstall.py +32 -0
- package/src/apothem/harnesses/open_claw/update.py +10 -0
- package/src/apothem/harnesses/open_claw/verify.py +11 -0
- package/src/apothem/harnesses/opencode/STANDARD-CONVENTION-PIN.md +76 -0
- package/src/apothem/harnesses/opencode/__init__.py +35 -0
- package/src/apothem/harnesses/opencode/capabilities.yml +43 -0
- package/src/apothem/harnesses/opencode/install.py +17 -0
- package/src/apothem/harnesses/opencode/materializer.py +31 -0
- package/src/apothem/harnesses/opencode/uninstall.py +34 -0
- package/src/apothem/harnesses/opencode/update.py +10 -0
- package/src/apothem/harnesses/opencode/verify.py +11 -0
- package/src/apothem/harnesses/qwen_code/STANDARD-CONVENTION-PIN.md +87 -0
- package/src/apothem/harnesses/qwen_code/__init__.py +37 -0
- package/src/apothem/harnesses/qwen_code/capabilities.yml +43 -0
- package/src/apothem/harnesses/qwen_code/install.py +19 -0
- package/src/apothem/harnesses/qwen_code/materializer.py +174 -0
- package/src/apothem/harnesses/qwen_code/templates/QWEN.md +30 -0
- package/src/apothem/harnesses/qwen_code/uninstall.py +34 -0
- package/src/apothem/harnesses/qwen_code/update.py +10 -0
- package/src/apothem/harnesses/qwen_code/verify.py +11 -0
- package/src/apothem/harnesses/trae/STANDARD-CONVENTION-PIN.md +70 -0
- package/src/apothem/harnesses/trae/__init__.py +49 -0
- package/src/apothem/harnesses/trae/capabilities.yml +34 -0
- package/src/apothem/harnesses/trae/install.py +38 -0
- package/src/apothem/harnesses/trae/templates/apothem-rules.md +37 -0
- package/src/apothem/harnesses/trae/uninstall.py +25 -0
- package/src/apothem/harnesses/trae/update.py +10 -0
- package/src/apothem/harnesses/trae/verify.py +11 -0
- package/src/apothem/harnesses/windsurf/STANDARD-CONVENTION-PIN.md +91 -0
- package/src/apothem/harnesses/windsurf/__init__.py +52 -0
- package/src/apothem/harnesses/windsurf/capabilities.yml +40 -0
- package/src/apothem/harnesses/windsurf/install.py +41 -0
- package/src/apothem/harnesses/windsurf/templates/apothem-rules.md +37 -0
- package/src/apothem/harnesses/windsurf/uninstall.py +25 -0
- package/src/apothem/harnesses/windsurf/update.py +10 -0
- package/src/apothem/harnesses/windsurf/verify.py +11 -0
- package/src/apothem/harnesses/zed/STANDARD-CONVENTION-PIN.md +92 -0
- package/src/apothem/harnesses/zed/__init__.py +57 -0
- package/src/apothem/harnesses/zed/capabilities.yml +38 -0
- package/src/apothem/harnesses/zed/install.py +41 -0
- package/src/apothem/harnesses/zed/templates/apothem-rules.md +32 -0
- package/src/apothem/harnesses/zed/uninstall.py +28 -0
- package/src/apothem/harnesses/zed/update.py +10 -0
- package/src/apothem/harnesses/zed/verify.py +11 -0
- package/src/apothem/hooks/README.md +81 -0
- package/src/apothem/hooks/__init__.py +24 -0
- package/src/apothem/hooks/askuserquestion_validator.py +380 -0
- package/src/apothem/hooks/dispatch.py +296 -0
- package/src/apothem/hooks/emit_hook_context.py +444 -0
- package/src/apothem/hooks/hooks.json +318 -0
- package/src/apothem/hooks/lib/README.md +39 -0
- package/src/apothem/hooks/lib/__init__.py +18 -0
- package/src/apothem/hooks/lib/bootstrap.ps1 +129 -0
- package/src/apothem/hooks/lib/bootstrap.sh +103 -0
- package/src/apothem/hooks/lib/events.py +51 -0
- package/src/apothem/hooks/lib/find-pwsh.ps1 +78 -0
- package/src/apothem/hooks/lib/find-pwsh.sh +76 -0
- package/src/apothem/hooks/lib/find-python.ps1 +63 -0
- package/src/apothem/hooks/lib/find-python.sh +97 -0
- package/src/apothem/hooks/lib/log.py +43 -0
- package/src/apothem/hooks/lib/resolve_root.py +264 -0
- package/src/apothem/hooks/messages/postcompact.md +14 -0
- package/src/apothem/hooks/messages/posttooluse-proactive-compaction.md +46 -0
- package/src/apothem/hooks/messages/precompact.md +14 -0
- package/src/apothem/hooks/messages/pretooluse-askuserquestion-recommended.md +65 -0
- package/src/apothem/hooks/messages/pretooluse-bash-plan-guard.md +97 -0
- package/src/apothem/hooks/messages/pretooluse-bash.md +39 -0
- package/src/apothem/hooks/messages/pretooluse-conformity.md +70 -0
- package/src/apothem/hooks/messages/pretooluse-dependency-guard.md +21 -0
- package/src/apothem/hooks/messages/pretooluse-edit-header-guard.md +61 -0
- package/src/apothem/hooks/messages/pretooluse-edit.md +21 -0
- package/src/apothem/hooks/messages/pretooluse-eval-guard.md +39 -0
- package/src/apothem/hooks/messages/pretooluse-notebookedit.md +11 -0
- package/src/apothem/hooks/messages/pretooluse-write-header-guard.md +45 -0
- package/src/apothem/hooks/messages/pretooluse-write-plan-guard.md +72 -0
- package/src/apothem/hooks/messages/pretooluse-write.md +21 -0
- package/src/apothem/hooks/messages/sessionstart.md +15 -0
- package/src/apothem/hooks/messages/stop.md +27 -0
- package/src/apothem/hooks/proactive_compaction_tracker.py +327 -0
- package/src/apothem/hooks/session_start_bootstrap.py +472 -0
- package/src/apothem/lib/README.md +42 -0
- package/src/apothem/lib/__init__.py +13 -0
- package/src/apothem/lib/atomic_io.py +189 -0
- package/src/apothem/lib/auditor.py +687 -0
- package/src/apothem/lib/clean_slate.py +396 -0
- package/src/apothem/lib/contexts.py +352 -0
- package/src/apothem/lib/data_home.py +255 -0
- package/src/apothem/lib/frontmatter.py +101 -0
- package/src/apothem/lib/harness_materializer.py +213 -0
- package/src/apothem/lib/harness_protocol.py +59 -0
- package/src/apothem/lib/harness_registry.py +282 -0
- package/src/apothem/lib/harness_registry_data.py +843 -0
- package/src/apothem/lib/install_ledger.py +347 -0
- package/src/apothem/lib/learning.py +540 -0
- package/src/apothem/lib/memory.py +347 -0
- package/src/apothem/lib/parallel_sweep.py +234 -0
- package/src/apothem/lib/plan_tiers.py +200 -0
- package/src/apothem/lib/plugin_bootstrap.py +132 -0
- package/src/apothem/lib/plugin_tree.py +599 -0
- package/src/apothem/lib/profile.py +755 -0
- package/src/apothem/lib/profile_projection.py +198 -0
- package/src/apothem/lib/propagation-manifest.yaml +878 -0
- package/src/apothem/lib/propagation.py +220 -0
- package/src/apothem/lib/python_resolver.py +189 -0
- package/src/apothem/lib/reporter.py +62 -0
- package/src/apothem/lib/workspace_migration.py +323 -0
- package/src/apothem/output-styles/README.md +41 -0
- package/src/apothem/output-styles/concise-engineer.md +49 -0
- package/src/apothem/output-styles/default-architect.md +52 -0
- package/src/apothem/output-styles/default.md +113 -0
- package/src/apothem/output-styles/forensic-auditor.md +63 -0
- package/src/apothem/py.typed +0 -0
- package/src/apothem/rules/README.md +121 -0
- package/src/apothem/rules/agent-capability-discipline-matrix.md +89 -0
- package/src/apothem/rules/agent-capability-discipline.md +78 -0
- package/src/apothem/rules/agent-orchestration-patterns.md +144 -0
- package/src/apothem/rules/agent-orchestration.md +65 -0
- package/src/apothem/rules/agents-md-convention.md +86 -0
- package/src/apothem/rules/agile-sprints-elements.md +135 -0
- package/src/apothem/rules/agile-sprints.md +64 -0
- package/src/apothem/rules/agnostic-posture-checklist.md +47 -0
- package/src/apothem/rules/agnostic-posture.md +48 -0
- package/src/apothem/rules/authoritative-referencing-quotation.md +50 -0
- package/src/apothem/rules/authoritative-referencing.md +66 -0
- package/src/apothem/rules/authority-inquiry-categories.md +58 -0
- package/src/apothem/rules/authority-inquiry.md +54 -0
- package/src/apothem/rules/auto-memory-topic-files.md +86 -0
- package/src/apothem/rules/auto-memory.md +67 -0
- package/src/apothem/rules/bidirectional-binding.md +123 -0
- package/src/apothem/rules/canonical-layout-reporting-tiers.md +212 -0
- package/src/apothem/rules/canonical-layout.md +60 -0
- package/src/apothem/rules/clean-architecture-layers.md +186 -0
- package/src/apothem/rules/clean-room-generation-protocols.md +124 -0
- package/src/apothem/rules/clean-room-generation.md +59 -0
- package/src/apothem/rules/code-craft-conventions.md +101 -0
- package/src/apothem/rules/code-craft-markdown.md +138 -0
- package/src/apothem/rules/code-craft-python.md +154 -0
- package/src/apothem/rules/code-craft-shell.md +192 -0
- package/src/apothem/rules/cognitive-identity-techniques.md +180 -0
- package/src/apothem/rules/cognitive-identity.md +81 -0
- package/src/apothem/rules/context-management-budget.md +46 -0
- package/src/apothem/rules/context-management-protocol.md +161 -0
- package/src/apothem/rules/context-management-scratch.md +128 -0
- package/src/apothem/rules/context-management.md +85 -0
- package/src/apothem/rules/definitiveness-virtues.md +67 -0
- package/src/apothem/rules/definitiveness.md +58 -0
- package/src/apothem/rules/determinism.md +81 -0
- package/src/apothem/rules/disclosure-ledger-markers.md +58 -0
- package/src/apothem/rules/disclosure-ledger.md +52 -0
- package/src/apothem/rules/dynamism.md +38 -0
- package/src/apothem/rules/etc-extension.md +57 -0
- package/src/apothem/rules/expertise-posture-elements.md +68 -0
- package/src/apothem/rules/expertise-posture.md +54 -0
- package/src/apothem/rules/freshness-facade.md +64 -0
- package/src/apothem/rules/harness-adapter-shape-schemas.md +162 -0
- package/src/apothem/rules/harness-adapter-shape.md +42 -0
- package/src/apothem/rules/host-discovery-manifests.md +50 -0
- package/src/apothem/rules/host-discovery.md +56 -0
- package/src/apothem/rules/i18n-discipline-locale-cohorts.md +120 -0
- package/src/apothem/rules/i18n-discipline.md +70 -0
- package/src/apothem/rules/interactive-questions-canonical-shapes.md +590 -0
- package/src/apothem/rules/interactive-questions-detail.md +41 -0
- package/src/apothem/rules/interactive-questions-sweep-matchers.md +184 -0
- package/src/apothem/rules/interactive-questions.md +89 -0
- package/src/apothem/rules/large-file-generation.md +112 -0
- package/src/apothem/rules/large-file-reading.md +59 -0
- package/src/apothem/rules/living-docs.md +85 -0
- package/src/apothem/rules/multi-agent-workflow.md +57 -0
- package/src/apothem/rules/operational-mandates-expanded.md +78 -0
- package/src/apothem/rules/operational-mandates.md +88 -0
- package/src/apothem/rules/option-annotation-form.md +60 -0
- package/src/apothem/rules/option-annotation.md +45 -0
- package/src/apothem/rules/own-voice-reimplementation.md +86 -0
- package/src/apothem/rules/performance-discipline.md +91 -0
- package/src/apothem/rules/persistent-conventions-vigilance-checklist.md +54 -0
- package/src/apothem/rules/persistent-conventions-vigilance.md +61 -0
- package/src/apothem/rules/plain-language.md +56 -0
- package/src/apothem/rules/planning-techniques.md +130 -0
- package/src/apothem/rules/pre-emission-gate-bars.md +86 -0
- package/src/apothem/rules/pre-emission-gate.md +54 -0
- package/src/apothem/rules/production-ready-prs-surfaces.md +162 -0
- package/src/apothem/rules/production-ready-prs.md +83 -0
- package/src/apothem/rules/propagation.md +63 -0
- package/src/apothem/rules/recommend-next-step.md +106 -0
- package/src/apothem/rules/refactoring-discipline.md +76 -0
- package/src/apothem/rules/session-closure.md +44 -0
- package/src/apothem/rules/sota-elevation-exemplars.md +76 -0
- package/src/apothem/rules/sota-elevation.md +52 -0
- package/src/apothem/rules/source-accessibility.md +58 -0
- package/src/apothem/rules/surgical-manipulation.md +48 -0
- package/src/apothem/rules/systemic-participation-relations.md +108 -0
- package/src/apothem/rules/systemic-participation.md +70 -0
- package/src/apothem/rules/ten-dimension-check-dimensions.md +52 -0
- package/src/apothem/rules/ten-dimension-check.md +59 -0
- package/src/apothem/rules/token-budget-discipline.md +81 -0
- package/src/apothem/rules/token-efficiency-rewrite-protocol.md +79 -0
- package/src/apothem/rules/token-efficiency-rewrite.md +77 -0
- package/src/apothem/rules/tool-use-discipline.md +48 -0
- package/src/apothem/rules/visual-leverage.md +102 -0
- package/src/apothem/schemas/NOTICE.md +9 -0
- package/src/apothem/schemas/README.md +104 -0
- package/src/apothem/schemas/__init__.py +176 -0
- package/src/apothem/schemas/advisory-finding.schema.json +111 -0
- package/src/apothem/schemas/agent.schema.json +106 -0
- package/src/apothem/schemas/authorship-header.txt +1 -0
- package/src/apothem/schemas/cohort-manifest.yaml +248 -0
- package/src/apothem/schemas/cohort-metadata-vocabulary.yaml +168 -0
- package/src/apothem/schemas/cohort.schema.json +113 -0
- package/src/apothem/schemas/command.schema.json +68 -0
- package/src/apothem/schemas/compatibility-matrix.yaml +432 -0
- package/src/apothem/schemas/context-fragment.schema.json +64 -0
- package/src/apothem/schemas/freshness-token-denylist.txt +51 -0
- package/src/apothem/schemas/handoff-manifest.yaml +353 -0
- package/src/apothem/schemas/header-exceptions.txt +141 -0
- package/src/apothem/schemas/header-visibility.yaml +39 -0
- package/src/apothem/schemas/learning-signal.schema.json +46 -0
- package/src/apothem/schemas/memory-record.schema.json +61 -0
- package/src/apothem/schemas/output-style.schema.json +40 -0
- package/src/apothem/schemas/plan.schema.json +51 -0
- package/src/apothem/schemas/plugin.schema.json +83 -0
- package/src/apothem/schemas/profile.example.yaml +70 -0
- package/src/apothem/schemas/profile.minimal.yaml +6 -0
- package/src/apothem/schemas/profile.schema.json +396 -0
- package/src/apothem/schemas/reference-token-denylist.txt +25 -0
- package/src/apothem/schemas/skill.schema.json +75 -0
- package/src/apothem/skills/README.md +93 -0
- package/src/apothem/skills/dependency-upgrade/SKILL.md +105 -0
- package/src/apothem/skills/dev-toolkit/SKILL.md +120 -0
- package/src/apothem/skills/diagram-authoring/SKILL.md +113 -0
- package/src/apothem/skills/document-authoring/SKILL.md +118 -0
- package/src/apothem/skills/ecosystem-audit/SKILL.md +108 -0
- package/src/apothem/skills/ecosystem-audit/references/audit-fortress.md +85 -0
- package/src/apothem/skills/ecosystem-audit/references/procedure.md +162 -0
- package/src/apothem/skills/eval-harness/SKILL.md +88 -0
- package/src/apothem/skills/incident-runbook/SKILL.md +92 -0
- package/src/apothem/skills/multi-source-research/SKILL.md +90 -0
- package/src/apothem/skills/plan-suite/SKILL.md +118 -0
- package/src/apothem/skills/plan-suite/master_template.md +1324 -0
- package/src/apothem/skills/projectify/SKILL.md +117 -0
- package/src/apothem/skills/prompt-engineering/SKILL.md +122 -0
- package/src/apothem/skills/refactor-extract/SKILL.md +85 -0
- package/src/apothem/skills/research-suite/SKILL.md +170 -0
- package/src/apothem/skills/research-suite/references/directory-structure.md +47 -0
- package/src/apothem/skills/research-suite/references/lifecycle.md +67 -0
- package/src/apothem/skills/research-suite/references/principal-investigator-framework.md +37 -0
- package/src/apothem/skills/research-suite/references/rigor-mandates.md +30 -0
- package/src/apothem/skills/research-suite/research_template.md +476 -0
- package/src/apothem/skills/secret-rotation/SKILL.md +87 -0
- package/src/apothem/skills/source-synthesis/SKILL.md +92 -0
- package/src/apothem/skills/surgical-guard/SKILL.md +118 -0
- package/src/apothem/skills/test-authoring/SKILL.md +85 -0
- package/src/apothem/skills/vuln-triage/SKILL.md +91 -0
- package/src/apothem/skills/workflow/SKILL.md +139 -0
- package/src/apothem/statuslines/README.md +26 -0
- package/src/apothem/statuslines/__init__.py +20 -0
- package/src/apothem/statuslines/conformity.json +5 -0
- package/src/apothem/statuslines/render.py +334 -0
- package/src/apothem/statuslines/statusline.md +50 -0
- package/src/apothem/templates/README.md +43 -0
- package/src/apothem/templates/agents-md-template.md +80 -0
- package/src/apothem/templates/consideration-log.md +39 -0
- package/src/apothem/templates/expertise-gap-log.md +56 -0
- package/src/apothem/templates/master-index-template.md +93 -0
- package/src/apothem/templates/potency-map.md +53 -0
- package/src/apothem/templates/preservation-audit.md +60 -0
- package/src/apothem/templates/question-resolution-audit.md +52 -0
- package/src/apothem/templates/trace-matrix-template.md +77 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "interactive-questions-detail"
|
|
3
|
+
description: "Path-filtered companion to interactive-questions.md carrying the authoring-discipline procedure and the anti-pattern catalog; demand-loaded on path match when a surface authors structured-inquiry invocations."
|
|
4
|
+
pathFilter: "**/commands/**/*.md, **/rules/**/*.md, **/skills/**/*.md, **/agents/**/*.md, **/hooks/**/*.md"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Interactive-Questions Authoring Detail & Anti-Patterns (Companion Sub-Rule)
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Carry the demand-load detail for the always-on parent `rules/interactive-questions.md`: the authoring-discipline procedure and the anti-pattern catalog. Loads on path match when a surface authors structured-inquiry invocations, so the detail pays its context cost only where questions are written.
|
|
15
|
+
|
|
16
|
+
## Authoring Discipline
|
|
17
|
+
|
|
18
|
+
Author every invocation in five ordered steps:
|
|
19
|
+
|
|
20
|
+
1. **Write the question first.** One sentence ending in `?`, naming the decision — not the implementation. The question fixes the decision space before any option is drafted.
|
|
21
|
+
2. **Derive options from the decision space.** Each option is a distinct, reachable outcome of the question. Two-to-four options (the choice-overload bound); the implicit `Other` covers the long tail. Labels are 1–5 words.
|
|
22
|
+
3. **Annotate each option** with the three-segment body per `rules/interactive-questions.md` §3: `rationale:` (observable consequence) · `recommendation:` (taxonomy value) · `default-pointer:` (named default OR `no-default: user decision required`).
|
|
23
|
+
4. **Cite a concrete driver** on every non-neutral `recommendation:` value (`recommended` / `discouraged` / `destructive-no-default`) — one of the six driver classes; never a vague-rationale phrase. Downgrade to `acceptable` when no driver supports the claim.
|
|
24
|
+
5. **Review before emission** for the four invariants: driver presence (§4), destructive-op no-default floor (§6), label↔body `(Recommended)` consistency (§3 bidirectional bind), and the two-to-four cardinality bound.
|
|
25
|
+
|
|
26
|
+
## Anti-Patterns
|
|
27
|
+
|
|
28
|
+
- **DON'T** issue a raw "Please confirm…" / "Which of…" / imperative-plus-`?` as primary input — **BECAUSE** it bypasses the schema and the annotation that biases-check the choice.
|
|
29
|
+
- **DON'T** batch destructive files into one invocation — **BECAUSE** per-file confirmation is the floor; one irreversible decision per invocation.
|
|
30
|
+
- **DON'T** mark a non-neutral recommendation without a concrete-driver why-clause — **BECAUSE** an un-driven nudge biases the operator invisibly.
|
|
31
|
+
- **DON'T** name a default on a destructive question — **BECAUSE** it makes the irreversible action the easy path; destructive ops are universally `no-default`.
|
|
32
|
+
- **DON'T** put `(Recommended)` on more than one option in a single-select question, or on a non-`recommended` body — **BECAUSE** the label↔body bind is bidirectional and a stray postfix corrupts the signal.
|
|
33
|
+
- **DON'T** fall back to prose silently when structured inquiry is available — **BECAUSE** the degradation MUST be logged with the conversation marker and a ledger row.
|
|
34
|
+
|
|
35
|
+
## Bindings (§0.j five-direction)
|
|
36
|
+
|
|
37
|
+
- **Drives →** The authoring review every structured-inquiry invocation passes before emission; the anti-pattern checks the parent §8 sweep matchers operationalize.
|
|
38
|
+
- **Satisfies →** The demand-load detail tier for the parent `interactive-questions.md` authoring discipline and anti-pattern catalog.
|
|
39
|
+
- **Established by ↑** `rules/interactive-questions.md` (the always-on parent this companion carries detail for, per the parent / companion-sub-rule pattern).
|
|
40
|
+
- **Gated by ←** The `pathFilter` glob (demand-loads only when a question-authoring surface is touched).
|
|
41
|
+
- **Cross-bound with ↔** `rules/interactive-questions.md` (parent — §9 Authoring Discipline and the Anti-Patterns catalog were moved here under the companion-sub-rule pattern); `rules/interactive-questions-canonical-shapes.md` and `rules/interactive-questions-sweep-matchers.md` (sibling companions carrying the schema worked-examples and the H1–H7 matcher catalog).
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "interactive-questions-sweep-matchers"
|
|
3
|
+
description: "Path-filtered companion rule carrying the canonical-channel sweep matcher specifications (H1–H7); demand-loaded when the parent `interactive-questions.md` rule's §8 anchor surfaces."
|
|
4
|
+
pathFilter: "**/commands/**/*.md, **/rules/**/*.md, **/skills/**/*.md, **/agents/**/*.md, **/hooks/**/*.md, **/CLAUDE.md, **/settings.json"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Interactive-Questions Sweep Matchers (Companion Sub-Rule)
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Specify the executable matcher catalog for the canonical-channel compliance gate declared at the parent rule's `rules/interactive-questions.md` §8 anchor. This companion is path-filtered: it loads when the assistant edits any of the governed-core surfaces the matchers sweep, keeping the parent's always-on payload lean while preserving full matcher fidelity at the demand-load surface. The parent rule remains the canonical home for the canonical-channel obligation, the three-segment option-annotation schema, the recommendation taxonomy, the harness fallback, the per-file destructive-op confirmation, and the default-pointer convention; this companion carries the H1–H7 sweep matcher catalog.
|
|
15
|
+
|
|
16
|
+
## Obligations
|
|
17
|
+
|
|
18
|
+
### 1. Heuristic Catalog (H1–H7)
|
|
19
|
+
|
|
20
|
+
The compliance gate sweeps for two heuristic classes: conversational-form heuristics (H1–H3), which detect raw conversational prompts that bypass the canonical channel; and annotation-compliance heuristics (H4–H7), which detect structured-inquiry invocation payloads that violate the option-annotation schema.
|
|
21
|
+
|
|
22
|
+
- **H1 — Imperative + question mark.** A sentence opens with an imperative verb ("Confirm", "Approve", "Choose", "Select", "Pick", "Decide") and ends with `?`. Exemption: the phrase appears inside a code fence, a blockquote marked as preserved conversation, or a raw-notes context explicitly tagged as the parent rule's §1 exception 1 material.
|
|
23
|
+
- **H2 — "Please confirm" / "Please approve" / "Please choose".** The literal phrase appears as a primary input prompt. Same exemption as H1.
|
|
24
|
+
- **H3 — "Which of the following".** The phrase opens a primary input prompt without an immediately preceding structured-inquiry invocation. Same exemption as H1.
|
|
25
|
+
- **H4 — Option without three-segment body.** A structured-inquiry invocation has any option whose `description` lacks any of the three canonical segments (`rationale:`, `recommendation:`, `default-pointer:`).
|
|
26
|
+
- **H5 — Non-neutral recommendation without concrete driver.** A `recommendation:` body value is `recommended`, `discouraged`, or `destructive-no-default`, and the same body segment carries no concrete-driver why-clause of the form admissible by `rules/interactive-questions-canonical-shapes.md` §3.2.1.
|
|
27
|
+
- **H6 — Label–body mismatch and cardinality.** An option's label carries the `(Recommended)` postfix but its body `recommendation:` value is not exactly `recommended`; an option's body value is exactly `recommended` and its own label does not carry the postfix; or a `multiSelect: false` question carries more than one recommended option. `multiSelect: true` questions may carry multiple recommended options when each label/body pair matches.
|
|
28
|
+
- **H7 — Destructive op without `no-default` floor.** A `recommendation:` body value is `destructive-no-default` and the same option's `default-pointer:` is not the `no-default: user decision required` form; or a question has at least one option marked `destructive-no-default` and another option in the same question carries a named default.
|
|
29
|
+
|
|
30
|
+
Every heuristic hit is a gate finding at severity HIGH unless the artifact is outside the interactive-surface catalog's compliance scope (fallback-permitted harnesses recording a compliant fallback use, raw-notes preservation contexts per §3). The H6 sweep is bidirectional — it checks both label→body and body→label.
|
|
31
|
+
|
|
32
|
+
### 2. Sweep Scope
|
|
33
|
+
|
|
34
|
+
The zero-match sweep runs across the ecosystem's governed-core tree:
|
|
35
|
+
|
|
36
|
+
- `commands/` — all `.md` files
|
|
37
|
+
- `rules/` — all `.md` files
|
|
38
|
+
- `skills/` — recursive, all `.md` / `.py` / `.sh` / `.ps1` / `.json` files
|
|
39
|
+
- `agents/` — all flat `<name>.md` entry points
|
|
40
|
+
- `hooks/` — recursive, all `.py` / `.sh` / `.ps1` / `.md` / `.json` files
|
|
41
|
+
- `settings.json` in the harness config root — root-level hook-configuration file
|
|
42
|
+
- `CLAUDE.md` — root-level ecosystem-config file
|
|
43
|
+
|
|
44
|
+
The sweep does not recurse into `<project-root>/.apothem/plans/` (plan-suite internal artifacts are exempt from the gate) or `<harness-root>/projects/` (per-project memory outside ecosystem authorship).
|
|
45
|
+
|
|
46
|
+
### 3. Exclusion Zones
|
|
47
|
+
|
|
48
|
+
Hits inside the following contexts are exempt from the zero-match verdict:
|
|
49
|
+
|
|
50
|
+
- **Raw-notes contexts** per the parent rule's §1 exception 1 — quoted conversational material preserved for audit fidelity. Preservation is explicit: the artifact declares itself as a preservation artifact (frontmatter `purpose: preserved-conversation` marker, or an enclosing `<raw-notes>…</raw-notes>` fence, or a blockquote whose preceding paragraph labels the block as preserved conversation).
|
|
51
|
+
- **Parent rule's own §1, §5, §6, and §Anti-Patterns bodies** — the parent rule specifies the patterns it regulates; the self-referential citations are definitional. The §1 Scope statement, the §5.2 fallback-shape worked example, the §6.4–§6.7 canonical option-set subsections, and the §Anti-Patterns first bullet may quote the forbidden phrases verbatim for definitional purposes.
|
|
52
|
+
- **This companion rule's own §1 H1–H7 catalog body** — the catalog specifies the patterns it regulates; its self-referential citations of the H1, H2, H3 trigger phrases are definitional and exempt.
|
|
53
|
+
- **Migration-ledger paths** — `ecosystem-remediation-ledger.md` and every per-sub-phase `ledger-fragment.md` under `.apothem/plans/*/phases/*/` may quote forbidden phrases as "before-state" evidence of a migration.
|
|
54
|
+
- **Code fences and blockquotes tagged as preserved conversation** — inline preservation anchors inside otherwise-non-exempt files.
|
|
55
|
+
|
|
56
|
+
### 4. Sweep Invocation Specification — H1–H3 (Conversational-Form)
|
|
57
|
+
|
|
58
|
+
The sweep uses ripgrep with the following per-heuristic invocations. Each invocation returns a hit count; the gate passes when every count equals the number of hits inside exclusion zones.
|
|
59
|
+
|
|
60
|
+
| Heuristic | Pattern (ripgrep regex) | Case | Exclusion-zone count |
|
|
61
|
+
|-----------|-------------------------|------|----------------------|
|
|
62
|
+
| H1 | `^(Confirm\|Approve\|Choose\|Select\|Pick\|Decide\|Specify\|Indicate)\b.*\?$` | literal | 0 active hits; 1 definitional reference at this companion's §1 H1 (inside quote marks, exempt) |
|
|
63
|
+
| H2 | `Please (confirm\|approve\|choose\|select)` | case-insensitive | 0 active hits; definitional references at the parent rule's §1, this companion's §1 H2, and the parent rule's §Anti-Patterns |
|
|
64
|
+
| H3 | `Which of (the following\|these)` | case-insensitive | 0 active hits; definitional references at the parent rule's §1 and this companion's §1 H3 |
|
|
65
|
+
|
|
66
|
+
Reproducible invocation from the ecosystem root (identical in POSIX bash and PowerShell 7+ since ripgrep is cross-platform):
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
rg --no-heading -nP '^(Confirm|Approve|Choose|Select|Pick|Decide|Specify|Indicate)\b.*\?$' \
|
|
70
|
+
commands/ rules/ skills/ agents/ hooks/ settings.json CLAUDE.md
|
|
71
|
+
|
|
72
|
+
rg --no-heading -ni 'Please (confirm|approve|choose|select)' \
|
|
73
|
+
commands/ rules/ skills/ agents/ hooks/ settings.json CLAUDE.md
|
|
74
|
+
|
|
75
|
+
rg --no-heading -ni 'Which of (the following|these)' \
|
|
76
|
+
commands/ rules/ skills/ agents/ hooks/ settings.json CLAUDE.md
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 5. Gate Admission — Interactive-Channel Compliance
|
|
80
|
+
|
|
81
|
+
The interactive-channel compliance gate is a named member of the airtightness composite alongside the numeric gates (5–19) and the other two named gates (Portability Gate, Kerning Gate). The gate's pass predicate is:
|
|
82
|
+
|
|
83
|
+
- For every conversational-form heuristic H1–H3: total hit count equals the documented exclusion-zone count. Equivalently, every conversational-question pattern that appears in the ecosystem is inside a declared exclusion zone (§3).
|
|
84
|
+
- For every annotation-compliance heuristic H4–H7: zero hits. The annotation sweep has no exclusion zone — every structured-inquiry invocation in the ecosystem must satisfy the annotation schema (parent rule's §3 three-segment body, §4 recommendation taxonomy, §6.2 default-floor on destructive ops, §3 bidirectional label-postfix rule).
|
|
85
|
+
|
|
86
|
+
Gate failures at HIGH severity block the composite's pass verdict. The gate's downstream enforcement arm is the semantic blind re-audit in the diagnostic phase, which re-executes §4's sweep specifications and verifies the exclusion-zone count matches the documented values. A drift (e.g., the H2 exclusion count rises without a corresponding definitional-use change recorded in the remediation ledger) is itself a gate finding.
|
|
87
|
+
|
|
88
|
+
### 6. H4–H7 Machine Matchers — Annotation-Compliance Heuristics
|
|
89
|
+
|
|
90
|
+
H4–H7 sweep the structured-inquiry invocation payloads themselves rather than free-form prose. Each heuristic's matcher semantics are specified below.
|
|
91
|
+
|
|
92
|
+
#### 6.1 H4 — Body-Segment Omission
|
|
93
|
+
|
|
94
|
+
**Pass predicate:** every option's `description` field contains all three body-segment markers `rationale:`, `recommendation:`, and `default-pointer:` in that order, separated by newlines or period-space per the parent rule's §3.
|
|
95
|
+
|
|
96
|
+
**Matcher:** for each structured-inquiry invocation, walk every option; for each option, test that its `description` string contains all three segment-marker tokens (case-sensitive literal match). Absence of any one token = HIGH-severity hit.
|
|
97
|
+
|
|
98
|
+
**Normative source:** parent rule's §3 Three-Segment Option Annotation.
|
|
99
|
+
|
|
100
|
+
#### 6.2 H5 — Non-Neutral Recommendation Without Concrete Driver
|
|
101
|
+
|
|
102
|
+
**Pass predicate:** every option whose body `recommendation:` value is one of `{recommended, discouraged, destructive-no-default}` carries a why-clause that cites at least one admissible driver class per `rules/interactive-questions-canonical-shapes.md` §3.2.1 AND does not match any phrase on `rules/interactive-questions-canonical-shapes.md` §3.2.2 forbid list.
|
|
103
|
+
|
|
104
|
+
**Matcher:** for each option, extract the body `recommendation:` value. If the value is `acceptable`, skip (neutral; no driver required). Otherwise, extract the why-clause (text after the `—` em-dash separator on the `recommendation:` segment line, up to the next newline). Test:
|
|
105
|
+
|
|
106
|
+
- **Admissibility test** — the why-clause contains at least one token from the six driver-class signature set: (1) a decision identifier of shape `D-\d+` or equivalent; (2) a risk identifier of shape `R-\d+`; (3) a constraint identifier of shape `C-\d+`; (4) an open-question identifier of shape `OQ-\d+`; (5) a rule-file path of shape `rules/*.md §X.Y.Z`; (6) an observed-state citation pattern — a measured metric + source, a file path + line range, a gate-result citation. At least one signature token must match.
|
|
107
|
+
- **Forbid-list test** — the why-clause does NOT contain any literal phrase from `rules/interactive-questions-canonical-shapes.md` §3.2.2 vague-rationale forbid list (case-insensitive). A match on the forbid list is a HIGH-severity hit even when an admissible token is also present (the forbid phrase must be removed or the recommendation downgraded to `acceptable`).
|
|
108
|
+
|
|
109
|
+
**Normative source:** `rules/interactive-questions-canonical-shapes.md` §3.2.1 Driver Taxonomy + §3.2.2 Vague-Rationale Forbid List.
|
|
110
|
+
|
|
111
|
+
#### 6.3 H6 — Label-Postfix ↔ Body-Value Bidirectional Consistency
|
|
112
|
+
|
|
113
|
+
**Pass predicate:** for every option, the bidirectional bind holds — `label` ends with ` (Recommended)` IFF body `recommendation:` value is exactly `recommended`. Additionally, `multiSelect: false` invocations have zero or one recommended option; `multiSelect: true` invocations may have one or more recommended options.
|
|
114
|
+
|
|
115
|
+
**Matcher:** for each option, extract the `(label, description)` coupled pair. Compute two booleans:
|
|
116
|
+
|
|
117
|
+
- `label_has_postfix` — the `label` string ends with the exact suffix ` (Recommended)` (one leading space, literal past-participle wrapped in parentheses, no trailing whitespace or punctuation).
|
|
118
|
+
- `body_is_recommended` — the body `recommendation:` value is exactly the string `recommended`.
|
|
119
|
+
|
|
120
|
+
Three failure modes (all HIGH-severity):
|
|
121
|
+
|
|
122
|
+
- **Missing postfix (body→label direction):** `body_is_recommended = true` AND `label_has_postfix = false`.
|
|
123
|
+
- **Spurious postfix (label→body direction):** `label_has_postfix = true` AND `body_is_recommended = false`.
|
|
124
|
+
- **Single-select multi-postfix:** invocation `multiSelect = false` AND more than one option has `body_is_recommended = true`.
|
|
125
|
+
|
|
126
|
+
Options with body values `acceptable`, `discouraged`, or `destructive-no-default` MUST carry no label postfix — absence is the normal state, not a finding. Multiple recommended options are compliant only on non-exclusive `multiSelect: true` invocations.
|
|
127
|
+
|
|
128
|
+
**Normative source:** parent rule's §3.1 Label Postfix Convention.
|
|
129
|
+
|
|
130
|
+
#### 6.4 H7 — Destructive-Op Missing No-Default Floor
|
|
131
|
+
|
|
132
|
+
**Pass predicate:** every option in a destructive-op invocation carries the verbatim string `no-default: user decision required` on its `default-pointer:` segment.
|
|
133
|
+
|
|
134
|
+
**Matcher:** for each structured-inquiry invocation, determine whether it is a destructive-op invocation by two signals:
|
|
135
|
+
|
|
136
|
+
1. **Op-type signal:** the invocation's option set matches one of the parent rule's §6.4–§6.7 canonical option-set templates (delete/rename/move/revert-uncommitted) by label-set intersection — the canonical set labels are `{Retire, Keep, Defer, Explain-first}` (§6.4), `{Rename-as-proposed, Keep-current, Propose-alternative, Defer}` (§6.5), `{Move-as-proposed, Keep-current, Propose-alternative, Defer}` (§6.6), `{Discard, Keep, Stash-for-later, Defer}` (§6.7).
|
|
137
|
+
2. **Taxonomy-value signal:** any option carries body `recommendation: destructive-no-default` (per the parent rule's §4.1 this is the destructive-irreversible taxonomy value).
|
|
138
|
+
|
|
139
|
+
An invocation satisfying either signal is a destructive-op invocation. For every option in such an invocation, test that the `default-pointer:` segment contains the verbatim string `no-default: user decision required`. Failure = HIGH-severity hit.
|
|
140
|
+
|
|
141
|
+
Two sub-conditions of H7:
|
|
142
|
+
|
|
143
|
+
- **Missing no-default marker** — the destructive-op invocation's option has a named-default pointer instead of the verbatim no-default marker.
|
|
144
|
+
- **Contradictory pointer mix** — the invocation has at least one option marked `destructive-no-default` and another option carries a named-default pointer (the parent rule's §6.2 consistency rule is violated).
|
|
145
|
+
|
|
146
|
+
**Normative source:** parent rule's §6.2 Default Floor + §6.8 Invocation-Shape Invariants + §7.3 Destructive-Op Invariant.
|
|
147
|
+
|
|
148
|
+
### 7. Payload Inspection Procedure
|
|
149
|
+
|
|
150
|
+
The H4–H7 matchers operate on structured-inquiry invocation payloads extracted from two source surfaces:
|
|
151
|
+
|
|
152
|
+
- **Native invocations** — call sites where the tool is invoked with a `questions` array. Extraction uses static pattern matching on the tool-invocation syntax (e.g., in command `.md` specifications that describe an invocation inline with `question: … / header: … / options: [ label / description / multiSelect ]` block form, or in the skill-template `{…}` block form). The matcher walks the `questions` array, then each question's `options` array, then each option's `label` and `description` pair.
|
|
153
|
+
- **Fallback prose mirrors** (per the parent rule's §5.2) — the fallback prose shape is a faithful mirror of the tool's schema. Extraction uses the fallback-form parser: the closing instruction `Reply with the label of your choice.` (or the multi-select variant) delimits the option list; each bullet `- <label>: <three-segment body>` is parsed into `(label, description)`.
|
|
154
|
+
|
|
155
|
+
For H6 (label-postfix ↔ body-value), the matcher treats `label` and `description` as a coupled pair — extracting the trailing parenthetical from `label` and the `recommendation:` segment from `description` together so both booleans in §6.3's pass predicate can be computed from a single option's payload.
|
|
156
|
+
|
|
157
|
+
For H7 (destructive-op no-default), the matcher first classifies the invocation as destructive using the §6.4 op-type and taxonomy-value signals, then walks every option's `default-pointer:` segment.
|
|
158
|
+
|
|
159
|
+
Exemption: the §3 exclusion zones apply equally to H4–H7. Invocation payloads inside the canonical-shapes companion's body (e.g., its §2.1, §2.2, §5.2, §3.2.4 worked examples) are definitional uses; the companion specifies the patterns it regulates, and its own worked examples are the normative source. The rule self-citation exemption covers these; the companion's §3.2.4 "Before" anti-example is specifically designed as a non-compliant example demonstrating the pattern to avoid and is covered by the rule-self-citation exemption.
|
|
160
|
+
|
|
161
|
+
### 8. Sweep Invocation Specification — H4–H7
|
|
162
|
+
|
|
163
|
+
Each H4–H7 heuristic has a reproducible sweep invocation. Because H4–H7 operate on structured payloads rather than line-oriented prose, the invocations use an AST-walk or JSON-path parser where the source format supports it; for Markdown source artifacts, the invocations combine ripgrep with structural context (`--multiline` and `--no-heading` flags).
|
|
164
|
+
|
|
165
|
+
| Heuristic | Incantation sketch (Markdown source — the tooling sub-phase materializes a full script) |
|
|
166
|
+
|-----------|------------------------------------------------------------------------------------------|
|
|
167
|
+
| H4 | `rg --multiline --no-heading -U 'structured inquiry[\s\S]*?options:[\s\S]*?(?:label:.*?(?!.*rationale:).*?(?!.*recommendation:).*?(?!.*default-pointer:))' <scope>` — matches any option block missing any of the three body-segment markers |
|
|
168
|
+
| H5 | Two-pass: (pass 1) `rg -nP 'recommendation:\s+(recommended\|discouraged\|destructive-no-default)\b([^\n]*)' <scope>` to enumerate non-neutral recommendations; (pass 2) for each match, verify the tail `[^\n]*` contains at least one driver-class signature token (D-/R-/C-/OQ-/rule-path/observed-state pattern) AND does not contain any forbid-list phrase |
|
|
169
|
+
| H6 | Two linked passes plus a cardinality pass: (a) `rg -nP '^\s+label:\s+.+(?<! \(Recommended\))$' <scope>` enumerating labels NOT ending with the canonical postfix, paired with their option's body `recommendation:` segment — hit when the body value is `recommended` (missing-postfix direction); (b) `rg -nP '^\s+label:\s+.+ \(Recommended\)$' <scope>` enumerating labels ending with the canonical postfix, paired with their option's body `recommendation:` segment — hit when the body value is not `recommended` (spurious-postfix direction); a label ending with the lowercase ` (recommended)` variant is itself a non-canonical-case hit; (c) count recommended options per invocation and hit when `multiSelect: false` has more than one |
|
|
170
|
+
| H7 | Two-step: (step 1) classify invocation as destructive by (a) label-set intersection with the parent rule's §6.4–§6.7 canonical sets OR (b) any option carrying `recommendation: destructive-no-default`; (step 2) for every option in a destructive invocation, verify `default-pointer:` segment contains the verbatim literal `no-default: user decision required` — hit on any option where the verbatim string is absent |
|
|
171
|
+
|
|
172
|
+
The annotation-compliance-sweep tooling materializes these sketches into a single runnable sweep script (POSIX bash + PowerShell 7+ equivalents) honoring the §4 cross-platform convention. The sweep script's executable matcher implementations are the authoritative realization of these specifications.
|
|
173
|
+
|
|
174
|
+
## Enforcement
|
|
175
|
+
|
|
176
|
+
Path-filtered (the eight glob patterns in this rule's `pathFilter` field), always-on at every seriousness level when in scope. Demand-loaded companion to `rules/interactive-questions.md` §8. The parent rule carries the canonical-channel obligation, the option-annotation schema, the recommendation taxonomy, the harness fallback, the per-file destructive-op confirmation, and the default-pointer convention; this companion carries the H1–H7 sweep matcher catalog. Together they constitute the canonical specification for user-input surface discipline and interactive-channel compliance heuristics.
|
|
177
|
+
|
|
178
|
+
## Bindings (§0.j five-direction)
|
|
179
|
+
|
|
180
|
+
- **Drives →** ● The H1–H7 heuristic sweep across the governed-core surface classes (commands, rules, skills, agents, hooks, `settings.json`, `CLAUDE.md`). ● The interactive-channel compliance gate's pass/fail verdict (§5 Gate Admission). ● The `scripts/dev/validate_ecosystem.py --check option-annotation` subcommand (the H4–H7 annotation-compliance matchers operationalize here). ◐ The semantic blind re-audit in the diagnostic phase (the gate's downstream-enforcement arm).
|
|
181
|
+
- **Satisfies →** ● CM-2 extension (rule-delegated companion sub-rule). ● the rules registry row "Interactive Questions Sweep Matchers". ● `rules/interactive-questions.md` §8 anchor (the parent rule's pointer to this companion's full executable matcher catalog).
|
|
182
|
+
- **Established by ↑** ● `rules/interactive-questions.md` §8 (parent-rule anchor). ● CM-2 extension. ● Option Annotation Discipline (the mandate the H4–H7 matchers enforce).
|
|
183
|
+
- **Gated by ←** ● The path-filter (the eight glob patterns) — this rule demand-loads only on governed-core surface touches. ● `rules/interactive-questions.md` always-on baseline (parent rule must be live for the §8 anchor to surface).
|
|
184
|
+
- **Cross-bound with ↔** ↔ `rules/interactive-questions.md` (parent rule; §8 anchor binds this companion). ↔ `scripts/dev/validate_ecosystem.py` (the `--check option-annotation` subcommand operationalizes the H4–H7 matchers; this rule specifies the matchers' executable semantics). ↔ `rules/operational-mandates.md` (CM-2 zero-assumptions's structured-inquiry surface delegates to the parent rule, which delegates the matcher catalog here).
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "interactive-questions"
|
|
3
|
+
description: "Canonical discipline for soliciting user input — the harness-neutral structured-inquiry channel is the sanctioned abstraction; every invocation carries a structured option annotation; destructive operations and ambiguity resolution route through this rule; a prose fallback shape covers harnesses that lack a native tool."
|
|
4
|
+
pathFilter: ""
|
|
5
|
+
alwaysApply: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Interactive Questions
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Govern every act of soliciting user input. One abstraction, one schema, one fallback.
|
|
15
|
+
|
|
16
|
+
## Obligations
|
|
17
|
+
|
|
18
|
+
### 1. Canonical Channel
|
|
19
|
+
|
|
20
|
+
The structured-inquiry channel is the **sole** sanctioned abstraction. Every surface **MUST** route through its native tool or documented fallback; free-form conversational prompts as primary input are retired. Three narrow exceptions: raw-notes preservation (quote, never reissue); fallback-prose per §5; harness-emitted dialogs outside this rule's scope.
|
|
21
|
+
|
|
22
|
+
### 2. Structured-Inquiry Shape (Companion Sub-Rule Anchor)
|
|
23
|
+
|
|
24
|
+
Every invocation carries `question` (one sentence ending `?`), `header` (≤12 chars), `options` (2–4, auto-implicit `Other`), `multiSelect`. Each option carries `label` (1–5 words) and `description` (three-segment body per §3).
|
|
25
|
+
|
|
26
|
+
(Companion Sub-Rule Anchor) See `rules/interactive-questions-canonical-shapes.md` §1 for worked examples.
|
|
27
|
+
|
|
28
|
+
### 3. Three-Segment Option Annotation (Companion Sub-Rule Anchor)
|
|
29
|
+
|
|
30
|
+
Every `description` carries three fixed-order segments: **rationale:** (observable consequence) · **recommendation:** (taxonomy value per §4; driver why-clause when non-neutral) · **default-pointer:** (named default OR `no-default: user decision required`). The label ` (Recommended)` postfix bidirectionally binds the body value `recommended`: single-select carries at most one recommended option; `multiSelect: true` MAY mark several.
|
|
31
|
+
|
|
32
|
+
(Companion Sub-Rule Anchor) See `rules/interactive-questions-canonical-shapes.md` §2 for the full schema, label-postfix specification, and failure modes.
|
|
33
|
+
|
|
34
|
+
### 4. Recommendation Taxonomy (Companion Sub-Rule Anchor)
|
|
35
|
+
|
|
36
|
+
Closed taxonomy `{recommended, acceptable, discouraged, destructive-no-default}`. Non-neutral values **MUST** cite a concrete driver; vague phrases are forbidden as sole justification — downgrade to `acceptable`.
|
|
37
|
+
|
|
38
|
+
(Companion Sub-Rule Anchor) See `rules/interactive-questions-canonical-shapes.md` §3 for the driver taxonomy, forbid list, downgrade path, and extension protocol.
|
|
39
|
+
|
|
40
|
+
### 5. Harness Fallback (Companion Sub-Rule Anchor)
|
|
41
|
+
|
|
42
|
+
When the harness exposes neither direct nor deferred structured inquiry, the prose fallback fires: a prose prompt mirroring the schema, the conversation marker `[FALLBACK — structured-inquiry channel unavailable]`, and a ledger row in `ecosystem-remediation-ledger.md`. Outside this context, free-form prose as primary input is forbidden.
|
|
43
|
+
|
|
44
|
+
(Companion Sub-Rule Anchor) See `rules/interactive-questions-canonical-shapes.md` §4 for the activation predicate, prose-shape example, and ledger schema.
|
|
45
|
+
|
|
46
|
+
### 6. Per-File Destructive-Op Confirmation (Companion Sub-Rule Anchor)
|
|
47
|
+
|
|
48
|
+
Every destructive op (delete, rename, move, overwrite, revert-uncommitted) **MUST** route through the channel per file — never batched. Every option carries `default-pointer: no-default: user decision required`; `multiSelect: true` is non-compliant; ` (Recommended)` **MUST NOT** mark a destructive option.
|
|
49
|
+
|
|
50
|
+
(Companion Sub-Rule Anchor) See `rules/interactive-questions-canonical-shapes.md` §5 for the canonical option-sets (Delete / Rename / Move / Revert) and invariants.
|
|
51
|
+
|
|
52
|
+
### 7. Default-Pointer Convention (Companion Sub-Rule Anchor)
|
|
53
|
+
|
|
54
|
+
Two forms: **named-default** (`<label> — <rationale>`, identical across options) or **no-default** (the verbatim `no-default: user decision required`). Destructive ops universally use no-default per §6.
|
|
55
|
+
|
|
56
|
+
(Companion Sub-Rule Anchor) See `rules/interactive-questions-canonical-shapes.md` §6 for worked examples.
|
|
57
|
+
|
|
58
|
+
### 8. Pattern-Detection Heuristics (Companion Sub-Rule Anchor)
|
|
59
|
+
|
|
60
|
+
The interactive-channel gate sweeps for conversational-prompt patterns and annotation compliance. The H1–H7 matcher catalog lives at `rules/interactive-questions-sweep-matchers.md`; its §3 exempts this rule's §1, §5, §6, Anti-Patterns as definitional. HIGH findings block the airtightness composite. The runtime PreToolUse `AskUserQuestion` validator additionally checks `(Recommended)`-marker well-formedness on the LIVE tool payload at call time (advisory by default; the strict opt-in blocks), closing the previously documented-but-unenforced call-time gap; see `rules/interactive-questions-canonical-shapes.md` §2.1.
|
|
61
|
+
|
|
62
|
+
### 9. Authoring Discipline (Companion Sub-Rule Anchor)
|
|
63
|
+
|
|
64
|
+
Write the question first; derive options; annotate; review. (Companion Sub-Rule Anchor) See `rules/interactive-questions-detail.md` §Authoring Discipline for the full five-step procedure.
|
|
65
|
+
|
|
66
|
+
## Seriousness Scaling
|
|
67
|
+
|
|
68
|
+
| Level | Discipline |
|
|
69
|
+
| ----- | ---------- |
|
|
70
|
+
| EXPLORING | Channel active; annotation encouraged; driver advisory |
|
|
71
|
+
| PERSONAL_USE | Channel + annotation + driver + per-file destructive confirmation mandatory |
|
|
72
|
+
| SHARED | Full; sweep on every change; ledger tagging mandatory |
|
|
73
|
+
| PUBLIC_LAUNCH | Zero tolerance; heuristic hits block; sweep is a numbered airtightness gate |
|
|
74
|
+
|
|
75
|
+
## Anti-Patterns (Companion Sub-Rule Anchor)
|
|
76
|
+
|
|
77
|
+
Six anti-patterns: schema-bypassing raw prompts, destructive batching, driver-less recommendation, destructive named-default, `(Recommended)` signal violation, silent fallback. (Companion Sub-Rule Anchor) See `rules/interactive-questions-detail.md` §Anti-Patterns for full bodies.
|
|
78
|
+
|
|
79
|
+
## Enforcement
|
|
80
|
+
|
|
81
|
+
Always-on. Implements CM-2 extension. Detail-tier at `rules/interactive-questions-canonical-shapes.md`; matchers at `rules/interactive-questions-sweep-matchers.md`.
|
|
82
|
+
|
|
83
|
+
## Bindings (§0.j five-direction)
|
|
84
|
+
|
|
85
|
+
- **Drives →** ● Every structured-inquiry invocation across the ecosystem (every command, rule, skill, agent, hook surface that solicits user input routes through the canonical channel). ● The three-segment option-annotation schema (every option's `description` carries `rationale:`, `recommendation:`, `default-pointer:`). ● The per-file destructive-op confirmation floor (§6 — every delete / rename / move / overwrite / revert routes through the structured-inquiry channel per-file). ● The fallback prose shape (§5 — the sole permitted free-form-looking prompt outside the canonical channel). ◐ The `(Recommended)` label postfix bidirectional bind with body `recommendation: recommended`.
|
|
86
|
+
- **Satisfies →** ● CM-2 extension (the structured-inquiry surface CM-2 delegates to). ● the rules registry row "Interactive Questions". ● Option Annotation Discipline (the mandate this rule's annotation schema enforces).
|
|
87
|
+
- **Established by ↑** ● CM-2 (Zero Assumptions — this rule is the structured-inquiry extension). ● Option Annotation Discipline. ● Authority Hygiene (per-file destructive-op confirmation operationalizes the no-silent-substitution invariant).
|
|
88
|
+
- **Gated by ←** ● `CLAUDE.md` always-loaded preamble. ● `rules/operational-mandates.md` (CM-2 inline definition delegates the structured-inquiry surface here).
|
|
89
|
+
- **Cross-bound with ↔** ↔ `rules/interactive-questions-canonical-shapes.md` (companion sub-rule carrying §2–§7 worked examples, schema bodies, taxonomy details, canonical option-set templates). ↔ `rules/interactive-questions-sweep-matchers.md` (companion sub-rule carrying the §8 H1–H7 matcher catalog). ↔ `rules/operational-mandates.md` (CM-2 inline anchor delegates here). ↔ `commands/plan-execute.md` + `commands/plan-generate.md` + `commands/plan-spec.md` + `commands/plan-review.md` (every plan-pipeline command's structured-inquiry invocations). ↔ `scripts/dev/validate_ecosystem.py` (the `--check option-annotation` subcommand operationalizes the H4–H7 matchers). ↔ `rules/agent-capability-discipline.md` (§6 destructive-op canonical option sets govern agent-capability invocations). ↔ `rules/agnostic-posture.md` (preference selection routes through the end user under the host-agnostic posture rather than being silently picked). ↔ `rules/interactive-questions-detail.md` (companion sub-rule carrying the §9 authoring-discipline procedure and the anti-pattern catalog moved out of the always-on body).
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "large-file-generation"
|
|
3
|
+
description: "Large file generation via incremental appends — assess size (Small <200 / Medium 200–500 / Large 500–1500 / Massive >1500 lines), then for Large+ plan sections first and append via Write-then-Edit so documents are never silently truncated or abandoned."
|
|
4
|
+
pathFilter: "**/.apothem/plans/**, **/.plans/**, **/*.md, **/docs/**"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Large File Generation via Incremental Appends
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Generate large files completely via systematic incremental appends when content exceeds practical single-output thresholds — never truncated, never silently abandoned.
|
|
15
|
+
|
|
16
|
+
## Obligations
|
|
17
|
+
|
|
18
|
+
### 1. Pre-Generation Assessment
|
|
19
|
+
|
|
20
|
+
Assess expected size before generating, and route by band:
|
|
21
|
+
|
|
22
|
+
| Band | Size | Handling |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| **Small** | < 200 lines / < 2000 tokens | Single `Write`. No special handling. |
|
|
25
|
+
| **Medium** | 200–500 lines / 2000–5000 tokens | Single `Write`, monitored for truncation. On cut-off, switch to incremental mode. |
|
|
26
|
+
| **Large** | 500–1500 lines / 5000–15000 tokens | Plan incremental generation from the start; divide into logical sections. |
|
|
27
|
+
| **Massive** | > 1500 lines / > 15000 tokens | MANDATORY incremental generation with explicit section planning, progress tracking, and inter-section coherence verification. |
|
|
28
|
+
|
|
29
|
+
### 2. Incremental Generation Protocol
|
|
30
|
+
|
|
31
|
+
**2.1 — Section planning.** Before writing any content, plan the complete document structure: list every section with an estimated line count; identify cross-reference points between sections; establish the voice, tone, heading hierarchy, and formatting convention that persists across all appends; externalize the plan to a scratch note (or state it explicitly) before beginning.
|
|
32
|
+
|
|
33
|
+
**2.2 — First write.** Use `Write` for the first section, establishing the document header / metadata / preamble, the table of contents or structural outline (where applicable), and the first logical section in full.
|
|
34
|
+
|
|
35
|
+
**2.3 — Subsequent appends.** For each subsequent section, use `Edit` to append after the last line of existing content: match the final lines as `old_string`, replace with those same lines plus the new section as `new_string`. Maintain identical formatting conventions (heading levels, list styles, code-block styles). Open each append with a brief coherence check (does this flow from the prior section?). Preserve every cross-reference established earlier. NEVER re-generate already-written content — append only.
|
|
36
|
+
|
|
37
|
+
**2.4 — Transition integrity.** At each section boundary, verify: the prior section's last paragraph and the new section's first paragraph read as one continuous document; numbering sequences (lists, figures, tables, sections) stay continuous; every forward reference from an earlier section is satisfied by the new content.
|
|
38
|
+
|
|
39
|
+
### 3. Coherence Guarantees
|
|
40
|
+
|
|
41
|
+
Every incrementally generated document satisfies four coherences:
|
|
42
|
+
|
|
43
|
+
- **Structural** — consistent heading hierarchy; no orphan sections, no duplicate section numbers.
|
|
44
|
+
- **Narrative** — reads as a single authored work, not a patchwork of fragments.
|
|
45
|
+
- **Reference** — every internal cross-reference (sections, figures, tables, code blocks) resolves correctly.
|
|
46
|
+
- **Format** — Markdown formatting, indentation, list styles, code-block languages, and emphasis patterns are uniform end to end.
|
|
47
|
+
|
|
48
|
+
### 4. Completion Verification
|
|
49
|
+
|
|
50
|
+
After the final append: read the complete file to verify end-to-end coherence (for files too large to read in one pass, read in overlapping segments with a 50-line overlap to verify transition zones); confirm the document has a proper ending, not an abrupt stop; confirm the section count matches the §2.1 plan.
|
|
51
|
+
|
|
52
|
+
### 5. Failure Recovery
|
|
53
|
+
|
|
54
|
+
If generation is interrupted (context pressure, error, tool failure): log the interruption point (which section, what remains); on resumption, read the last 50 lines of the existing file to re-establish context; continue from the exact interruption point — never restart or duplicate; after recovery, run the §2.4 transition-integrity check at the recovery boundary.
|
|
55
|
+
|
|
56
|
+
## Seriousness Scaling
|
|
57
|
+
|
|
58
|
+
| Level | Large File Generation Behavior |
|
|
59
|
+
| ----- | ------------------------------ |
|
|
60
|
+
| EXPLORING | Size assessment before generation. Basic incremental mode for large files. Section plans optional |
|
|
61
|
+
| PERSONAL_USE | Size assessment + incremental mode for medium+ files. Section plan recommended for large files |
|
|
62
|
+
| SHARED | Full protocol: mandatory section plan for large+ files. Coherence verification (§3) after every incremental generation. Transition-integrity checks at every append |
|
|
63
|
+
| PUBLIC_LAUNCH | Full protocol + completion verification (§4). Section plans externalized before generation. Overlapping-read verification for massive files. Coherence failures block completion |
|
|
64
|
+
|
|
65
|
+
## Decision Tree
|
|
66
|
+
|
|
67
|
+
```mermaid
|
|
68
|
+
%%{ init: { "theme": "neutral" } }%%
|
|
69
|
+
%% verified: 2026-04-27 %%
|
|
70
|
+
%% provenance: rules/large-file-generation.md §1 (pre-generation assessment) %%
|
|
71
|
+
%% cross-reference: rules/large-file-generation.md §2 (incremental generation protocol) %%
|
|
72
|
+
flowchart TD
|
|
73
|
+
Start[File generation request] --> Size{Estimated size}
|
|
74
|
+
Size -->|< 200 lines / Small| Single[Single Write call · no special handling]
|
|
75
|
+
Size -->|200-500 / Medium| MidWrite[Single Write · monitor for truncation]
|
|
76
|
+
Size -->|500-1500 / Large| Plan[Plan complete document structure first]
|
|
77
|
+
Size -->|> 1500 / Massive| MassivePlan[Mandatory section plan · explicit progress tracking]
|
|
78
|
+
MidWrite --> Trunc{Output truncated?}
|
|
79
|
+
Trunc -->|yes| SwitchInc[Switch to incremental mode]
|
|
80
|
+
Trunc -->|no| Done[Single-shot success]
|
|
81
|
+
Plan --> First[Write first section · header + outline + first body]
|
|
82
|
+
MassivePlan --> First
|
|
83
|
+
SwitchInc --> First
|
|
84
|
+
First --> Append[Append next section via Edit · match tail of prior content]
|
|
85
|
+
Append --> Trans[Transition integrity check · numbering · cross-refs · format coherence]
|
|
86
|
+
Trans --> More{More sections in plan?}
|
|
87
|
+
More -->|yes| Append
|
|
88
|
+
More -->|no| Verify[Read full file end-to-end · verify coherence]
|
|
89
|
+
Verify --> Inter{Interrupted mid-generation?}
|
|
90
|
+
Inter -->|yes| Recover[Re-read last 50 lines · resume from interruption point]
|
|
91
|
+
Recover --> Append
|
|
92
|
+
Inter -->|no| Done
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Anti-Patterns
|
|
96
|
+
|
|
97
|
+
- **DON'T** generate a 1000+ line file in a single Write call — **BECAUSE** it risks silent truncation with no recovery path.
|
|
98
|
+
- **DON'T** re-generate earlier sections when appending later ones — **BECAUSE** it wastes tokens, risks inconsistency, and drifts from the original content.
|
|
99
|
+
- **DON'T** skip the section plan — **BECAUSE** unplanned incremental generation produces documents lacking structural coherence with inconsistent depth across sections.
|
|
100
|
+
- **DON'T** append without reading the tail of existing content — **BECAUSE** transition zones become jarring and numbering breaks.
|
|
101
|
+
|
|
102
|
+
## Enforcement
|
|
103
|
+
|
|
104
|
+
Path-filtered (`**/.apothem/plans/**`, `**/.plans/**`, `**/*.md`, `**/docs/**`), scaling per the table above. Implements CM-23. Canonical specification for large file generation via incremental appends.
|
|
105
|
+
|
|
106
|
+
## Bindings (§0.j five-direction)
|
|
107
|
+
|
|
108
|
+
- **Drives →** ● Every large file emission across plan suites and docs (§1 Pre-Generation Assessment routes by size band; §2 Incremental Generation Protocol governs the writes). ● Every Phase Report emission exceeding the medium-band threshold (§2.3 subsequent-appends operationalizes the CM-23B incremental protocol). ● Every CHANGELOG / docs-site / massive-spec authoring session above the 1500-line threshold. ◐ Compaction triggers at the 500-line emission threshold (cross-bound with CM-19 in `rules/context-management.md` §3).
|
|
109
|
+
- **Satisfies →** ● CM-23 (Large File Generation — rule-delegated mandate). ● the rules registry row "Large File Generation".
|
|
110
|
+
- **Established by ↑** ● CM-23. ● the artifact directories (.apothem/plans/, .plans/, docs/, *.md class declarations).
|
|
111
|
+
- **Gated by ←** ● The path-filter (`**/.apothem/plans/**`, `**/.plans/**`, `**/*.md`, `**/docs/**`) — this rule activates only on matching artifact touches. ● `rules/clean-room-generation.md` §2 Writing Protocol baseline (every artifact passes through the Writing Protocol before size-driven branching).
|
|
112
|
+
- **Cross-bound with ↔** ↔ `rules/context-management.md` (CM-19 compaction discipline triggers at the 500-line emission threshold per §3 of that rule). ↔ `rules/clean-room-generation.md` (§2 Writing Protocol governs *what* to write; this rule governs *how* to safely write it when the size exceeds the single-write band). ↔ `commands/plan-execute.md` Step 7 (Phase Report emission cites CM-23A pre-generation size assessment). ↔ `rules/token-efficiency-rewrite.md` (CM-23 write-side incremental-append budget protocol; token-efficiency-rewrite complements at the read-side / always-on rewrite tier). ↔ `rules/large-file-reading.md` (sibling read-side rule with matching size-bands and segmentation logic).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "large-file-reading"
|
|
3
|
+
description: "Large file reading via targeted segments — Grep to locate, Glob for traversal, Read with offset/limit; never load a full file when a segment suffices. Read-side analogue of large-file-generation."
|
|
4
|
+
pathFilter: ""
|
|
5
|
+
alwaysApply: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Large File Reading via Targeted Segments
|
|
11
|
+
|
|
12
|
+
## Obligations
|
|
13
|
+
|
|
14
|
+
### 1. Pre-Read Assessment
|
|
15
|
+
|
|
16
|
+
Assess size before reading:
|
|
17
|
+
|
|
18
|
+
- **Small** (< 200): full-read MAY proceed.
|
|
19
|
+
- **Medium** (200–500): segment reads SHOULD be preferred for scoped tasks.
|
|
20
|
+
- **Large** (500–1500): locate first; read only cited ranges.
|
|
21
|
+
- **Massive** (> 1500): structure first; full-read forbidden unless every section is load-bearing AND recorded per §4.
|
|
22
|
+
|
|
23
|
+
### 2. Locate-Before-Read Protocol
|
|
24
|
+
|
|
25
|
+
When the task names an identifier, heading, or symbol: `Grep -n` first, `Read` the cited range with a tight buffer, re-`Grep` before any escalation. A named target MUST NOT trigger a full-read.
|
|
26
|
+
|
|
27
|
+
### 3. Structural Traversal Protocol
|
|
28
|
+
|
|
29
|
+
`Glob` for sibling discovery; `Grep` for headings, signatures, frontmatter fields. Descend into a body only when the mapped structure shows it is needed.
|
|
30
|
+
|
|
31
|
+
### 4. Segmentation Discipline
|
|
32
|
+
|
|
33
|
+
Right-size each `offset` / `limit`, track multi-segment coverage, and record every Large+ full-read exception in the disclosure ledger per `rules/disclosure-ledger.md` (path, band, driver).
|
|
34
|
+
|
|
35
|
+
## Seriousness Scaling
|
|
36
|
+
|
|
37
|
+
| Level | Large File Reading Behavior |
|
|
38
|
+
| ----- | --------------------------- |
|
|
39
|
+
| EXPLORING | Size awareness; segment-based reads encouraged on Large+ files |
|
|
40
|
+
| PERSONAL_USE | Pre-read assessment + locate-before-read on Medium+ files |
|
|
41
|
+
| SHARED+ | Segment-only on Large+ files; full-read exceptions require disclosure-ledger rationale |
|
|
42
|
+
|
|
43
|
+
## Anti-Patterns
|
|
44
|
+
|
|
45
|
+
- **DON'T** full-read when `Grep` plus a segment answers the question.
|
|
46
|
+
- **DON'T** skip locate-before-read for a named target.
|
|
47
|
+
- **DON'T** re-read overlapping ranges without tracking.
|
|
48
|
+
|
|
49
|
+
## Enforcement
|
|
50
|
+
|
|
51
|
+
Always-on at every seriousness level, scaling per the table above. Canonical specification for size-aware file reading.
|
|
52
|
+
|
|
53
|
+
## Bindings (§0.j five-direction)
|
|
54
|
+
|
|
55
|
+
- **Drives →** Every file-consultation surface across the ecosystem (every `Read` invocation against a non-trivial-size file routes through the pre-read assessment at §1 and the locate-before-read protocol at §2). The `Grep` / `Glob` first-pass discipline at every search-before-implement step per CM-4. The segmentation discipline at §4 on every multi-segment file consult.
|
|
56
|
+
- **Satisfies →** Project `CLAUDE.md` reading-discipline obligations; the read-side half of the context-budget invariant declared at `rules/context-management.md` §7.
|
|
57
|
+
- **Established by ↑** `rules/large-file-generation.md` (sibling write-side rule — same essence, applied to writing). `rules/context-management.md` §7 Context Budget Discipline (this rule operationalizes the read-side of §7.2 Demand Loading).
|
|
58
|
+
- **Gated by ←** The size-band thresholds at §1 (small files bypass the protocol). The trivial-vs-non-trivial threshold inherited from the project's CLAUDE.md scope.
|
|
59
|
+
- **Cross-bound with ↔** ↔ `rules/large-file-generation.md` (sibling; write-side analogue with matching size-bands and segmentation logic). ↔ `rules/context-management.md` (CM-12 lean-context discipline; this rule's segmentation is one of the primary read-side levers preserving context budget). ↔ `rules/token-budget-discipline.md` (read-side analogue of the always-on body-size ceiling; both rules optimize the same gradient on different surfaces). ↔ `rules/clean-room-generation.md` (CM-4 Search Before Implement uses `Grep` / `Glob` first; this rule canonicalizes the locate-before-read shape that CM-4 search relies on). ↔ `rules/tool-use-discipline.md` (locate-before-read is the observe-step discipline at the file tier of that rule's observe → decide → act loop).
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "living-docs"
|
|
3
|
+
description: "Every change to a documented public surface — a CLI command or flag, a harness adapter, a profile field, an installer flag or environment variable, a configuration key, or any surface with a page under site/content/docs/ — MUST update its documentation page in the same change-set; source-generated reference pages are kept current by re-running the reference-inventory generator and committing the regenerated pages."
|
|
4
|
+
pathFilter: "**/site/content/docs/**, **/src/apothem/cli/**, **/src/apothem/harnesses/**, **/src/apothem/schemas/profile.schema.json, **/scripts/installer/**"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Living Documentation — Same-Change-Set Docs for Every Documented Public Surface
|
|
11
|
+
|
|
12
|
+
## What this rule enforces
|
|
13
|
+
|
|
14
|
+
Documentation is part of the change, not a follow-up. When a behavior change touches a **documented public surface**, the page describing that surface **MUST** be updated in the **same change-set** as the behavior change. This is the documentation analogue of the production-ready same-change-set discipline at `rules/production-ready-prs.md`: just as a code change ships its tests, CHANGELOG entry, and conformant commit together, a public-surface change ships its docs update together. A documented surface that drifts ahead of its page — even transiently across a commit boundary — is non-conformant. Apothem self-applies this rule: its own docs tree under `site/content/docs/` is kept current under the same binding it ships to host projects.
|
|
15
|
+
|
|
16
|
+
## Pre-conditions
|
|
17
|
+
|
|
18
|
+
The rule applies whenever a change touches a documented public surface:
|
|
19
|
+
|
|
20
|
+
| Surface | Source of truth | Documented at |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| **CLI command / flag** | `src/apothem/cli/` | `site/content/docs/reference/cli.mdx` |
|
|
23
|
+
| **Harness adapter** | `src/apothem/harnesses/<name>/` | the harness-registry reference + the harness's how-to page |
|
|
24
|
+
| **Profile field** | `src/apothem/schemas/profile.schema.json` | the profile-fields reference |
|
|
25
|
+
| **Installer flag / env var** | `scripts/installer/` | the install how-to |
|
|
26
|
+
| **Configuration key / any other** | — | its page under `site/content/docs/` |
|
|
27
|
+
|
|
28
|
+
The rule does NOT apply to internal-only surfaces with no public docs page (private helpers, test fixtures, conformity matchers) — they carry no living-docs obligation. Trivial-scope edits per the host's threshold that do not alter a documented surface's behavior, signature, or default are exempt.
|
|
29
|
+
|
|
30
|
+
## Required behavior
|
|
31
|
+
|
|
32
|
+
### 1. Same-Change-Set Docs Update
|
|
33
|
+
|
|
34
|
+
A change to a documented public surface **MUST** update the corresponding page in the same change-set. Deferring the docs update to a later commit or PR is forbidden — the follow-up never lands, and the page is stale at the merge boundary. The update covers every observable shift the change introduces: a renamed flag updates the flag's documented name; a new profile field documents its type, default, and meaning; a removed adapter removes its registry row and how-to page.
|
|
35
|
+
|
|
36
|
+
### 2. Source-Generated Reference Pages
|
|
37
|
+
|
|
38
|
+
Three reference surfaces are **source-generated** — derived mechanically from the source of truth, never hand-maintained:
|
|
39
|
+
|
|
40
|
+
- **CLI reference** (`reference/cli.md`) — generated from the Click command tree.
|
|
41
|
+
- **Harness-registry reference** — generated from the registered `apothem.harnesses` entry points.
|
|
42
|
+
- **Profile-fields reference** — generated from `profile.schema.json`.
|
|
43
|
+
|
|
44
|
+
A change touching any of these source surfaces **MUST** regenerate the affected pages by re-running `node site/scripts/update-reference-inventory.mjs` and committing the regenerated pages in the same change-set. The generator output is authoritative; hand-edits to a source-generated page are overwritten on the next regeneration and **MUST NOT** be relied upon.
|
|
45
|
+
|
|
46
|
+
### 3. Hand-Authored How-To Pages
|
|
47
|
+
|
|
48
|
+
Hand-authored pages (how-to guides, conceptual pages, tutorials) describing a changed surface **MUST** be updated by hand in the same change-set. Adding a CLI flag that changes a documented workflow updates both the regenerated `reference/cli.md` **and** the relevant how-to page that walks the workflow.
|
|
49
|
+
|
|
50
|
+
### 4. Worked Example — Adding a CLI Flag
|
|
51
|
+
|
|
52
|
+
A developer adds a `--dry-run` flag to `apothem install` in `src/apothem/cli/`. The living-docs binding requires the same PR to:
|
|
53
|
+
|
|
54
|
+
1. **Regenerate `reference/cli.md`** — run `node site/scripts/update-reference-inventory.mjs`; the regenerated page now lists `--dry-run` with its help text under `apothem install`. Commit the regenerated page.
|
|
55
|
+
2. **Update the relevant how-to** — the install how-to under `site/content/docs/` that walks `apothem install` gains a sentence on `--dry-run` (when to use it, what it previews). Edit by hand.
|
|
56
|
+
|
|
57
|
+
Both land in the same change-set as the flag. Ship the flag without the docs update and CI's docs-reference-sync / stale-doc drift gate (§Mechanical enforcement) fails: it re-runs the generator in a clean tree and diffs the result against the committed pages; a non-empty diff means the committed `reference/cli.md` is stale, and the gate blocks the merge until the regenerated page is committed.
|
|
58
|
+
|
|
59
|
+
## Mechanical enforcement
|
|
60
|
+
|
|
61
|
+
The **docs-reference-sync / stale-doc drift gate** enforces this rule in CI. It runs `node site/scripts/update-reference-inventory.mjs` in a clean checkout and diffs the regenerated source-generated pages against the committed pages. A non-empty diff means a documented source surface changed without its reference page being regenerated; the gate fails and names the stale page. This is the docs analogue of the production-ready CI-green discipline: a stale source-generated reference page blocks the merge the way a failing test does. Hand-authored how-to drift is a reasoned review check, not mechanically diffable — reviewers confirm a surface change carries its how-to update.
|
|
62
|
+
|
|
63
|
+
## Disclosure surface
|
|
64
|
+
|
|
65
|
+
Every living-docs outcome is recorded in the disclosure ledger per `rules/disclosure-ledger.md`:
|
|
66
|
+
|
|
67
|
+
- `[Living-Docs — surface: <cli | harness | profile-field | installer | config-key>; page: <docs-path>; update: regenerated | hand-edited]` for every same-change-set docs update.
|
|
68
|
+
- `[Living-Docs — regenerated: reference/cli.md | harness-registry | profile-fields; generator: update-reference-inventory.mjs]` for every source-generated page refresh.
|
|
69
|
+
- `[Living-Docs — deferred: docs update out-of-scope because <reason>; tracking: <where>]` only when the surface change genuinely carries no documented public effect; the deferral names why the page needs no update.
|
|
70
|
+
|
|
71
|
+
## Failure tells
|
|
72
|
+
|
|
73
|
+
A PR adding a CLI flag with no change to `reference/cli.md`. A new harness adapter merged without a registry-reference regeneration or a how-to page. A renamed profile field whose documented name still shows the old identifier. An installer env var added to `scripts/installer/` with no mention in the install how-to. A hand-edit to a source-generated reference page (overwritten on the next regeneration). A "docs update coming in a follow-up PR" note on a surface-changing diff. A green local build with a CI docs-reference-sync drift-gate failure (the committed reference page is stale against the source of truth).
|
|
74
|
+
|
|
75
|
+
## Bindings (§0.j five-direction)
|
|
76
|
+
|
|
77
|
+
- **Drives →** The same-change-set docs update on every documented-public-surface change under this rule's `pathFilter`. The regeneration of source-generated reference pages via `node site/scripts/update-reference-inventory.mjs`. The CI docs-reference-sync / stale-doc drift gate that diffs regenerated pages against committed pages.
|
|
78
|
+
- **Satisfies →** The living-documentation mandate (documented surfaces never drift ahead of their pages). The documentation analogue of the production-ready same-change-set discipline.
|
|
79
|
+
- **Established by ↑** The production-ready same-change-set discipline at `rules/production-ready-prs.md` (this rule projects that discipline onto the documentation surface). The source-generated reference-inventory generator at `site/scripts/update-reference-inventory.mjs`.
|
|
80
|
+
- **Gated by ←** The `pathFilter` (documented public source surfaces + the docs tree only; internal-only surfaces are exempt). The trivial-scope threshold (edits that do not alter a documented surface's behavior, signature, or default are exempt). The CI docs-reference-sync drift gate's clean-tree diff baseline.
|
|
81
|
+
- **Cross-bound with ↔** `rules/production-ready-prs.md` (the production-ready same-change-set discipline this rule is the documentation analogue of). `rules/systemic-participation.md` (a documented surface and its page are reciprocal participants; the page is the surface's downstream consumer). `rules/recommend-next-step.md` (terminal-surface forward-move discipline this rule's tail honors). `rules/propagation.md` (the full reference-graph propagation mandate this docs-tier rule is one participant of).
|
|
82
|
+
|
|
83
|
+
## Recommended Next Step
|
|
84
|
+
|
|
85
|
+
**Run `node site/scripts/update-reference-inventory.mjs`** after any change to a CLI command, harness adapter, or profile field, then commit the regenerated reference pages alongside the source change so the CI docs-reference-sync drift gate stays green, per `rules/recommend-next-step.md`.
|