@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,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "authority-inquiry"
|
|
3
|
+
description: "Inquire, do not invent — names, emails, handles, hostnames, organizations, scope, security, naming, infrastructure, and version pins are discovered or asked, never fabricated. Routes through the canonical structured-inquiry channel."
|
|
4
|
+
pathFilter: ""
|
|
5
|
+
alwaysApply: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Authoritative Inquiry — Inquire, Do Not Invent
|
|
11
|
+
|
|
12
|
+
## What this rule enforces
|
|
13
|
+
|
|
14
|
+
This rule binds **M5 — Authority Principle** (inquiry half; the discovery half lives at `rules/host-discovery.md`). The ecosystem MUST NOT fabricate personal, authoritative, or otherwise user-bound data. Names, emails, handles, hostnames, organizations, tenants, endpoints, credentials, scope direction, host-unratified naming choices, retention policies, version pins on host-mutable surfaces, and undeclared infrastructure decisions — none is invented. Each is either (i) **discovered** from a ratified host source of truth with provenance recorded per `rules/host-discovery.md`, or (ii) **inquired** from the user via the typed inquiry surface at `rules/interactive-questions.md`. A plausible-looking guess is never an acceptable substitute for either path.
|
|
15
|
+
|
|
16
|
+
## Pre-conditions
|
|
17
|
+
|
|
18
|
+
The rule applies whenever any host-project artifact about to be emitted depends on data in one of the seven inquiry categories below. Required-category inquiries (Identity, Scope direction, Security, Naming-of-public-surfaces) MUST block emission until answered; optional-category inquiries fall back to the recommended option per `rules/option-annotation.md` and record the fallback as a finding.
|
|
19
|
+
|
|
20
|
+
## Required behavior
|
|
21
|
+
|
|
22
|
+
### The Seven Inquiry Categories (Companion Sub-Rule Anchor)
|
|
23
|
+
|
|
24
|
+
The seven categories are: **Identity**, **Scope direction**, **Preference**, **Security**, **Naming**, **Infrastructure**, **Version pins**. Required-category inquiries (Identity, Scope direction, Security, Naming-of-public-surfaces) block emission via `<USER-CONFIRM:id=<id>>` placeholders rejected at pre-emission gate row 5; optional-category inquiries fall back to the **Recommended** option per `rules/option-annotation.md` and record the fallback as a finding. Full per-category "Forbidden to invent" / "Inquire because" columns and the required-vs-optional explanatory paragraph live at `rules/authority-inquiry-categories.md` §1 (Companion Sub-Rule Anchor).
|
|
25
|
+
|
|
26
|
+
### Inquiry surface — canonical channel
|
|
27
|
+
|
|
28
|
+
Every inquiry MUST route through the canonical structured-inquiry schema at `rules/interactive-questions.md` §2 Structured-Inquiry Shape. The structured-inquiry subset (the `questions` array, the option-set shape, the three-segment annotation, the recommendation taxonomy, the per-file destructive-op confirmation) is owned there; this rule carries the **outward-projection form** — the seven-category catalog naming *what* must be inquired, *when*, and *which* categories are required versus optional.
|
|
29
|
+
|
|
30
|
+
Where the host runtime exposes no structured inquiry, the structured prose fallback at `rules/interactive-questions.md` §5 replaces the tool invocation. Every fallback use MUST be logged in the change ledger per `rules/disclosure-ledger.md` so the degradation is never silent.
|
|
31
|
+
|
|
32
|
+
### Carved-Out Auto-Decisions (Companion Sub-Rule Anchor)
|
|
33
|
+
|
|
34
|
+
To prevent inquiry fatigue, a closed catalog of carve-out classes (pure validity, pure rigor, universally-safe security, pure formatting normalization, internal reference repair) is decided **without inquiry** — disclosed in the change ledger as `[Default — applied: <decision>; class: <carve-out>]`. Anything outside the carve-out goes through the inquiry surface. The full bulleted carve-out catalog lives at `rules/authority-inquiry-categories.md` §2 (Companion Sub-Rule Anchor).
|
|
35
|
+
|
|
36
|
+
## Disclosure surface
|
|
37
|
+
|
|
38
|
+
Inquiry outcomes are recorded in the disclosure ledger per `rules/disclosure-ledger.md`:
|
|
39
|
+
|
|
40
|
+
- `[Inquiry — id: <inquiry-id>; category: <category>; outcome: <user-choice|fallback-to-recommended>]` for every inquired-and-resolved choice.
|
|
41
|
+
- `[Default — applied: <auto-decision>; class: <carve-out class>]` for every carve-out auto-decision.
|
|
42
|
+
- `<USER-CONFIRM:id=<id>>` placeholders for unresolved required inquiries (these block emission per the pre-emission gate row 5 at `rules/pre-emission-gate.md`; the mechanical matcher at `conformity/user_confirm_grep.py` enforces the placeholder absence at hook level).
|
|
43
|
+
|
|
44
|
+
## Failure tells (Companion Sub-Rule Anchor)
|
|
45
|
+
|
|
46
|
+
The full failure-tells enumeration — invented identity / endpoint / handle data, unverified `mailto:` fields, guessed CODEOWNERS handles, host-mutable version pins without ratification, unfilled `<USER-CONFIRM:…>` placeholders, silently-resolved required-category decisions — lives at `rules/authority-inquiry-categories.md` §3 (Companion Sub-Rule Anchor).
|
|
47
|
+
|
|
48
|
+
## Bindings (§0.j five-direction)
|
|
49
|
+
|
|
50
|
+
- **Drives →** Every authoritative-data emission across every ecosystem surface. The pre-flight inquiry set every `commands/*.md` Step 1 emits per `rules/authority-inquiry.md`. The inquiry surface every `agents/*.md` return format carries. The mechanical `<USER-CONFIRM:…>`-placeholder grep at `conformity/user_confirm_grep.py`.
|
|
51
|
+
- **Satisfies →** the fifteen-mandate registry row **M5 — Authority Principle**. `rules/authority-inquiry.md` — Required Categories (the seven-row catalog this rule canonicalizes). `rules/authority-inquiry.md` Carved-Out Auto-Decisions (the carve-out catalog this rule reproduces).
|
|
52
|
+
- **Established by ↑** the fifteen-mandate registry (ratifies M5). `rules/authority-inquiry.md` (the seven-category catalog this rule reproduces with operational depth). `rules/authority-inquiry.md` Carved-Out Auto-Decisions.
|
|
53
|
+
- **Gated by ←** The §8.1 trivial-vs-non-trivial threshold (trivial work runs the abbreviated check covering only the placeholder-presence sweep). `CLAUDE.md` always-loaded preamble.
|
|
54
|
+
- **Cross-bound with ↔** `rules/authority-inquiry-categories.md` (path-filtered companion sub-rule carrying the §1 seven-category catalog, §2 carve-out auto-decisions, and §3 failure-tells enumeration). `rules/interactive-questions.md` (the canonical structured-inquiry invocation schema, three-segment annotation, recommendation taxonomy, harness fallback, and per-file destructive-op confirmation are owned there; this rule carries the seven-category outward-projection catalog and delegates the structured-inquiry subset). `rules/host-discovery.md` (M5 discovery half — the discovery and inquiry halves form a complete coverage of authority data). `rules/disclosure-ledger.md` (M2 — every inquiry outcome and carve-out default is recorded in the ledger). `rules/option-annotation.md` (M7 — every inquiry's option set carries the recommended marker). `rules/operational-mandates.md` §CM-2 Zero Assumptions (M5 is the outward-projection form of CM-2's structured-inquiry discipline). `rules/pre-emission-gate.md` (M4 — bar 5 of the gate enforces this rule's `<USER-CONFIRM:…>`-placeholder absence and unresolved-inquiry array population). `rules/i18n-discipline.md` (M5 — cohort amendments routed via the structured-inquiry channel). `rules/source-accessibility.md` (M5 — the inaccessible-source escalation reaches a trusted source through the operator-interview channel owned here).
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "auto-memory-topic-files"
|
|
3
|
+
description: "Path-filtered companion sub-rule carrying the topic-file management discipline, ecosystem-specific memory hygiene, session-end evaluation procedure, decision tree, and anti-patterns declared at the parent `auto-memory.md` rule's anchors; demand-loaded when the assistant edits any memory artifact."
|
|
4
|
+
pathFilter: "**/memory/**, **/MEMORY.md, **/projects/**/memory/**, **/promotion-ledger.md"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Auto Memory — Topic Files & Lifecycle (Companion Sub-Rule)
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Specify the topic-file management contract, ecosystem-specific memory hygiene, session-end evaluation procedure, decision tree, and anti-patterns delegated by the parent `rules/auto-memory.md` Companion Sub-Rule Anchors. This companion is path-filtered: it loads when the assistant edits any memory artifact (any file under `memory/**`, `projects/**/memory/**`, root-level `MEMORY.md`, or the global `promotion-ledger.md`), keeping the parent's always-on payload lean while preserving full convention fidelity at the demand-load surface. The parent rule remains the canonical home for the §1 Memory vs. Other State Files classification and §2 What NOT to Write bans; this companion carries the operational depth.
|
|
15
|
+
|
|
16
|
+
## Obligations
|
|
17
|
+
|
|
18
|
+
### 1. Ecosystem-Specific Memory Discipline
|
|
19
|
+
|
|
20
|
+
- **MEMORY.md as index:** MUST stay under 200 lines, used as a concise index pointing to topic files. **Overflow procedure:** when approaching 200 lines, identify groups of related entries (3+ on the same domain), promote each group to a new topic file, and replace the group in MEMORY.md with a single index pointer. MEMORY.md MUST NOT exceed 200 lines — entries beyond 200 are truncated by the loader and become invisible.
|
|
21
|
+
- **Topic files:** Kebab-case names reflecting the domain (e.g., `debugging.md`, `patterns.md`). Each self-contained.
|
|
22
|
+
- **Deduplication:** Before writing, check whether an existing entry covers the topic; update it rather than duplicate.
|
|
23
|
+
- **Staleness pruning:** When reading memory files, evaluate accuracy and remove entries referencing outdated versions, deleted files, or changed conventions.
|
|
24
|
+
- **Contradiction resolution:** Current project state and user instructions always win over memory entries; update or remove contradictions immediately.
|
|
25
|
+
- **Corruption resilience:** If MEMORY.md or a topic file is malformed (truncated, garbled, unparseable), re-derive its content from the other memory files and project state. MEMORY.md is an index — reconstruct from topic files on disk. Topic files are self-contained — reconstruct from project artifacts and CLAUDE.md. Log the corruption and notify the user.
|
|
26
|
+
|
|
27
|
+
### 2. Topic File Management
|
|
28
|
+
|
|
29
|
+
- **Naming:** Kebab-case, domain-reflective. File name should be the topic's natural label (e.g., `debugging.md`, `api-patterns.md`, `overhaul-log.md`). Avoid generic names (`notes.md`, `misc.md`).
|
|
30
|
+
- **Size target:** 50–150 lines per topic file. Under 50: consider merging into a related topic. Over 150: consider splitting by subtopic.
|
|
31
|
+
- **Split signal:** A topic file covers 3+ distinct subtopics with no shared context → split into separate files. Update MEMORY.md index.
|
|
32
|
+
- **Merge signal:** Two topic files have >50% overlapping content or are always consulted together → merge into one. Update MEMORY.md index.
|
|
33
|
+
- **Self-containment:** Each topic file must be independently useful. Minimize cross-references between topic files — prefer duplicating a key fact over creating a dependency chain.
|
|
34
|
+
- **MEMORY.md index discipline:** Every topic file must be listed in the Topic Files table. Orphan topic files (on disk but not indexed) are invisible and unmaintained — either index them or delete them.
|
|
35
|
+
- **Cross-project patterns:** Two memory tiers exist: project-specific (`<harness-root>/projects/{hash}/memory/`) and global (`<harness-root>/memory/`). Project memory is the default destination. At PUBLIC_LAUNCH seriousness, when the user reports or you recall (from global memory) that a pattern appears in another project, flag the current instance as an extraction candidate for user approval. On approval, move to global memory and remove the project-specific copy. Global memory follows the same MEMORY.md-as-index discipline. At lower seriousness levels, cross-project extraction requires explicit user request.
|
|
36
|
+
- **Promotion-ledger discipline:** Every promotion event between the project-specific and global tiers is recorded in `<harness-root>/memory/promotion-ledger.md` with the canonical four-field record schema — `source` (project-specific path being promoted) · `target` (global path post-promotion) · `date` (ISO 8601 `YYYY-MM-DD`) · `rationale` (one-sentence justification grounded in a concrete driver: cross-project recurrence count, architectural anchor, or convention universality). The ledger is the authoritative record; promotion events without a ledger row are convention violations. The same schema applies in reverse for the rare demotion case (global → project-specific) when the cross-project applicability assumption no longer holds.
|
|
37
|
+
|
|
38
|
+
### 3. Session-End Evaluation
|
|
39
|
+
|
|
40
|
+
Context-management §2.5 and the Stop hook delegate session-end memory evaluation to this rule. At session end:
|
|
41
|
+
|
|
42
|
+
- **Scan for write candidates:** Review decisions, corrections, confirmed patterns, and user preferences from the session. Apply the parent rule's §1 decision rule: plan/task-specific → skip (goes to PROGRESS.md). Reusable technique → skip (goes to skill). Stable fact/convention/preference/insight → memory candidate.
|
|
43
|
+
- **Deduplicate:** Check existing memory files for each candidate. If already covered, update if stale; skip if current.
|
|
44
|
+
- **Write or skip:** At EXPLORING, write only if user explicitly requested. At PERSONAL_USE+, write confirmed patterns and preferences. At SHARED+, also write architectural decisions and debugging insights.
|
|
45
|
+
- **Prune:** At SHARED+, remove any entries contradicted or made stale by this session's work.
|
|
46
|
+
|
|
47
|
+
### 4. Decision Tree
|
|
48
|
+
|
|
49
|
+
```mermaid
|
|
50
|
+
%%{ init: { "theme": "neutral" } }%%
|
|
51
|
+
%% verified: 2026-04-27 %%
|
|
52
|
+
%% provenance: rules/auto-memory.md §1 (memory vs. other state) %%
|
|
53
|
+
%% cross-reference: rules/auto-memory-topic-files.md §3 (session-end evaluation) %%
|
|
54
|
+
flowchart TD
|
|
55
|
+
Start[Memory write candidate surfaces] --> Q1{Plan or task specific?}
|
|
56
|
+
Q1 -->|yes| Plan[Write to PROGRESS.md or PLAN-NOTES.md]
|
|
57
|
+
Q1 -->|no| Q2{Reusable technique with detection signal?}
|
|
58
|
+
Q2 -->|yes| Skill[Write a skill at skills/-name-/SKILL.md]
|
|
59
|
+
Q2 -->|no| Q3{Stable fact, convention, preference, or insight?}
|
|
60
|
+
Q3 -->|no| Skip[Discard]
|
|
61
|
+
Q3 -->|yes| Q4{Existing memory entry covers the topic?}
|
|
62
|
+
Q4 -->|yes| Update[Update existing entry · prune staleness]
|
|
63
|
+
Q4 -->|no| Q5{User · feedback · project · or reference type?}
|
|
64
|
+
Q5 --> Topic[Choose or author topic file in memory/]
|
|
65
|
+
Topic --> Index[Append index pointer to memory/MEMORY.md]
|
|
66
|
+
Index --> Done[Memory persisted]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 5. Anti-Patterns
|
|
70
|
+
|
|
71
|
+
- **DON'T** write speculative conclusions from reading a single file — **BECAUSE** unverified entries pollute memory.
|
|
72
|
+
- **DON'T** duplicate CLAUDE.md content in memory — **BECAUSE** contradictions emerge as CLAUDE.md evolves.
|
|
73
|
+
- **DON'T** use memory as a task tracker — **BECAUSE** PROGRESS.md and PLAN-NOTES.md serve that purpose.
|
|
74
|
+
- **DON'T** store ephemeral facts (branch names, PR numbers, temporary URLs) — **BECAUSE** they will be stale by next session.
|
|
75
|
+
|
|
76
|
+
## Enforcement
|
|
77
|
+
|
|
78
|
+
Path-filtered (the four glob patterns in this rule's `pathFilter` field — `**/memory/**`, `**/MEMORY.md`, `**/projects/**/memory/**`, `**/promotion-ledger.md`), always-on at every seriousness level when in scope. Demand-loaded companion to `rules/auto-memory.md`. The parent rule carries the §1 Memory vs. Other State Files classification table, the §2 What NOT to Write bans, and the Seriousness Scaling table; this companion carries the topic-file management contract, ecosystem-specific hygiene, session-end evaluation procedure, decision tree, and anti-patterns. Together they constitute the canonical specification for memory lifecycle.
|
|
79
|
+
|
|
80
|
+
## Bindings (§0.j five-direction)
|
|
81
|
+
|
|
82
|
+
- **Drives →** ● Every topic-file naming, sizing, splitting, merging decision under any project's `memory/` tree. ● The MEMORY.md index discipline (under-200-lines invariant; orphan-topic prevention). ● Every promotion / demotion event between the project-specific and global memory tiers (the four-field ledger schema at §2). ● The session-end memory evaluation procedure that the Stop hook fires.
|
|
83
|
+
- **Satisfies →** ● CM-26 (Auto Memory Lifecycle — rule-delegated mandate; this companion is the path-filtered subset). ● the rules registry row "Auto Memory" (the canonical specification splits across the parent and this companion). ● `rules/auto-memory.md` Companion Sub-Rule Anchors (the parent rule's pointers to this companion's full specification).
|
|
84
|
+
- **Established by ↑** ● `rules/auto-memory.md` (parent-rule anchors). ● CM-26 inline definition. ● the artifact directories (memory paths declared there).
|
|
85
|
+
- **Gated by ←** ● The path-filter (`**/memory/**`, `**/MEMORY.md`, `**/projects/**/memory/**`, `**/promotion-ledger.md`) — this rule demand-loads only on memory-artifact touches. ● `rules/auto-memory.md` always-on baseline (parent rule's anchors must be live for the companion to demand-load coherently).
|
|
86
|
+
- **Cross-bound with ↔** ↔ `rules/auto-memory.md` (parent rule; this companion's content is delegated through the parent's Companion Sub-Rule Anchors). ↔ `rules/context-management.md` (the §2.5 phase-exit protocol delegates memory evaluation to the parent rule, which delegates the procedure here). ↔ `rules/persistent-conventions-vigilance.md` (memory feeds gap-detection per §4 of the conventions rule; gap-detection writes to memory). ↔ `hooks/messages/stop.md` (the Stop hook context that operationalizes the §3 session-end evaluation). ↔ `memory/promotion-ledger.md` (the global memory's promotion-ledger anchor declared at §2).
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "auto-memory"
|
|
3
|
+
description: "Auto memory lifecycle augmenting the harness built-in — classifies memory against PROGRESS.md / PLAN-NOTES.md / skills (stable fact/convention/preference/insight → memory; plan/task-specific → PROGRESS/PLAN-NOTES; reusable technique with detection signal → skill), bans session-specific context / incomplete info / CLAUDE.md duplicates / plan-specific decisions / ephemeral facts, and anchors topic-file hygiene to the path-filtered companion."
|
|
4
|
+
pathFilter: ""
|
|
5
|
+
alwaysApply: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Auto Memory Lifecycle
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Augment the harness's built-in auto memory with ecosystem discipline: separate memory from other state artifacts, enforce topic organization, and prevent content misplacement. Canonical specification for CM-26 (Auto Memory Lifecycle).
|
|
15
|
+
|
|
16
|
+
## Obligations
|
|
17
|
+
|
|
18
|
+
### 1. Memory vs. Other State Files
|
|
19
|
+
|
|
20
|
+
Memory is one of four persistent-state artifacts. Place content by destination:
|
|
21
|
+
|
|
22
|
+
| Artifact | Location | Holds |
|
|
23
|
+
| -------- | -------- | ------- |
|
|
24
|
+
| **Memory** | `<harness-root>/projects/{hash}/memory/` | Stable patterns, conventions, preferences, architectural decisions, debugging insights |
|
|
25
|
+
| **PROGRESS.md** | Plan suite directory | Current task state, phase tracker, Resumption Contract |
|
|
26
|
+
| **PLAN-NOTES.md** | Plan suite directory | Decisions, Q&A audit trail, gap analysis |
|
|
27
|
+
| **Skills** | `skills/*/SKILL.md` | Reusable techniques with detection signals and procedures |
|
|
28
|
+
|
|
29
|
+
**Decision rule.** Plan- or task-specific → PROGRESS.md or PLAN-NOTES.md. Reusable technique with a detection signal → skill. Stable fact, convention, preference, or insight → memory.
|
|
30
|
+
|
|
31
|
+
### 2. What NOT to Write
|
|
32
|
+
|
|
33
|
+
Memory MUST NOT carry any of six classes:
|
|
34
|
+
|
|
35
|
+
- **Session-specific context** — current task details, in-progress work, temporary state (→ PROGRESS.md).
|
|
36
|
+
- **Incomplete information** — unverified assumptions, single-file speculative conclusions.
|
|
37
|
+
- **CLAUDE.md duplicates** — anything that duplicates or contradicts CLAUDE.md.
|
|
38
|
+
- **Plan-specific decisions** (→ PLAN-NOTES.md).
|
|
39
|
+
- **Reusable techniques with detection signals** (→ skills).
|
|
40
|
+
- **Ephemeral facts** — values stale by next session (branch names, PR numbers).
|
|
41
|
+
|
|
42
|
+
### 3. Topic-File Hygiene & Lifecycle (Companion Sub-Rule Anchor)
|
|
43
|
+
|
|
44
|
+
MEMORY.md indexing, topic-file naming / sizing / split / merge, deduplication, staleness pruning, contradiction resolution, corruption resilience, two-tier project / global layout, promotion-ledger schema, Stop-hook session-end procedure, decision tree, anti-patterns. See `rules/auto-memory-topic-files.md`.
|
|
45
|
+
|
|
46
|
+
## Seriousness Scaling
|
|
47
|
+
|
|
48
|
+
> **Invariant.** §2 bans (no session-specific context, no incomplete information, no CLAUDE.md duplicates, no plan-specific decisions, no reusable techniques in memory, no ephemeral facts) apply at every seriousness level. The table below specifies what to ADD per level on top of those bans, not what to relax.
|
|
49
|
+
|
|
50
|
+
| Level | Memory Behavior |
|
|
51
|
+
| ----- | --------------- |
|
|
52
|
+
| EXPLORING | Write only user-requested memories. If the user's request conflicts with §2 bans, explain the conflict and decline rather than silently proceed |
|
|
53
|
+
| PERSONAL_USE | Write confirmed patterns and user preferences |
|
|
54
|
+
| SHARED | Full lifecycle. Write architectural decisions, debugging insights. Prune stale entries on detection |
|
|
55
|
+
| PUBLIC_LAUNCH | Full lifecycle. Staleness audit mandatory at session start. Cross-project extraction candidates flagged proactively. Active pruning every session |
|
|
56
|
+
|
|
57
|
+
## Enforcement
|
|
58
|
+
|
|
59
|
+
Always-on at every seriousness level, scaling per the table above. Implements CM-26. Canonical specification for memory lifecycle, topic organization, and content placement.
|
|
60
|
+
|
|
61
|
+
## Bindings (§0.j five-direction)
|
|
62
|
+
|
|
63
|
+
- **Drives →** ● Every memory write/update/prune cycle across every project's `<harness-root>/projects/{hash}/memory/` tree. ● Session-end memory evaluation per the Stop hook's CM-26 dispatch. ● `MEMORY.md` index discipline (under-200-lines invariant). ◐ Cross-project pattern extraction at the highest seriousness tier (the promotion-ledger discipline at `rules/auto-memory-topic-files.md` §2 records every promotion event). ◐ The two-tier memory layout (project-specific `<harness-root>/projects/{hash}/memory/` vs. global `<harness-root>/memory/`).
|
|
64
|
+
- **Satisfies →** ● CM-26 (Auto Memory Lifecycle — rule-delegated mandate). ● the rules registry row "Auto Memory". ● the artifact directories (project vs. global memory tier declaration).
|
|
65
|
+
- **Established by ↑** ● CM-26. ● the artifact directories (memory paths declared there). ● `rules/context-management.md` §2.5 Externalize-On-Phase-Exit (memory evaluation is delegated here).
|
|
66
|
+
- **Gated by ←** ● Session-end Stop hook firing (the canonical session-boundary trigger). ● PROGRESS.md / PLAN-NOTES.md / skill artifacts taking precedence per the §1 decision rule (memory is the residual destination).
|
|
67
|
+
- **Cross-bound with ↔** ↔ `rules/auto-memory-topic-files.md` (path-filtered companion sub-rule carrying §1 ecosystem-specific hygiene, §2 topic-file management, §3 session-end evaluation, §4 decision tree, and §5 anti-patterns). ↔ `rules/context-management.md` (the §2.5 phase-exit protocol delegates memory evaluation here; this rule's §5 session-end evaluation pairs with that delegation). ↔ `rules/persistent-conventions-vigilance.md` (memory feeds gap-detection per §4 of the conventions rule; gap-detection writes to memory). ↔ `hooks/messages/stop.md` (the Stop hook context that operationalizes the session-end evaluation). ↔ `memory/promotion-ledger.md` (the global memory's promotion-ledger anchor declared at `rules/auto-memory-topic-files.md` §2).
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "bidirectional-binding"
|
|
3
|
+
description: "Every substantive structural element carries reciprocal bindings to its peers in canonical five-direction notation — Drives → / Driven by ← / Satisfies → / Established by ↑ / Cross-bound with ↔. Every binding declared in one direction has a reciprocal back-pointer at the other end; half-edges are structural failures. A Bidirectional Binding Matrix appendix summarizes the graph where structure permits."
|
|
4
|
+
pathFilter: "**/*.md, **/docs/**, **/CLAUDE.md, **/rules/**, **/skills/**, **/agents/**, **/commands/**, **/adr/**, **/rfcs/**, **/architecture*, **/design*"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Bidirectional Binding & Phase-Execution Threading
|
|
11
|
+
|
|
12
|
+
## What this rule enforces
|
|
13
|
+
|
|
14
|
+
This rule binds **M10 — Bidirectional Binding & Phase-Execution Threading**. Every substantive structural element in a host-project artifact — section, sub-section, contract, requirement, test, dependency declaration, citation, cross-reference, phase, sprint, milestone — MUST carry **explicit, reciprocal, persistently-maintained bindings** to its peers in the canonical **five-direction notation** below. Every binding declared in one direction MUST have a **reciprocal back-pointer** at the other end. A binding without its reciprocal is a **half-edge** — a structural failure, never an aesthetic preference or a deferral candidate. Where structure permits, a **Bidirectional Binding Matrix** MUST be appended summarizing the graph.
|
|
15
|
+
|
|
16
|
+
**Phase-execution threading.** Where the artifact describes ordered execution (a pipeline, a migration, a release process, a deployment, a research procedure), the order MUST be **named, numbered, anchor-bearing, and fully cited at both ends** — every phase declares what it invokes, what it advances, what gates it, and what it gates. Standing gates (mandates active throughout) MUST be explicitly marked.
|
|
17
|
+
|
|
18
|
+
## Pre-conditions
|
|
19
|
+
|
|
20
|
+
The rule applies whenever a host-project artifact carries substantive structural elements — sections depending on sections, contracts satisfying or establishing contracts, phases driving or gating phases, peers mutually reinforcing. Trivial-scope artifacts per the trivial-vs-non-trivial threshold (single-file edits ≤ 5 lines AND no public-API change AND no behavioral shift) are exempt; the trigger is structural surface, not Markdown presence. A linear narrative with no structural dependencies (a top-to-bottom how-to with no cross-references) is exempt — but the moment the artifact carries a cross-reference, a satisfies-relation, a gate, or mutual reinforcement, the bindings requirement applies.
|
|
21
|
+
|
|
22
|
+
## Required behavior
|
|
23
|
+
|
|
24
|
+
### 1. The Five Directions — Canonical Notation
|
|
25
|
+
|
|
26
|
+
The bindings notation reproduces the five canonical symbols **verbatim**. Variants, abbreviations, translations, or substitutions (Unicode-emoji arrows, ASCII-only `->`, alternative wording like "Causes" or "Contributes-to") are non-conformant.
|
|
27
|
+
|
|
28
|
+
| Direction | Symbol | Semantic | Reciprocal direction |
|
|
29
|
+
|---|---|---|---|
|
|
30
|
+
| **Drives →** | `→` (forward arrow) | What this element causes, produces, advances downstream | **Driven by ←** |
|
|
31
|
+
| **Driven by ←** | `←` (backward arrow) | What introduces / gates / triggers this element | **Drives →** |
|
|
32
|
+
| **Satisfies →** | `→` (forward arrow) | What end-state / criterion / acceptance test this element establishes | **Established by ↑** |
|
|
33
|
+
| **Established by ↑** | `↑` (upward arrow) | What element(s) produce this outcome (anchors, ratifications, design sources) | **Satisfies →** |
|
|
34
|
+
| **Cross-bound with ↔** | `↔` (bidirectional arrow) | Sibling elements that mutually reinforce; symmetric reciprocal | **Cross-bound with ↔** (self-reciprocal) |
|
|
35
|
+
|
|
36
|
+
**Reading discipline.** The arrow reads in the natural direction of the prose: "Drives → A" reads "drives A"; "Driven by ← B" reads "driven by B". The arrow belongs to the section header, not as a separator inside a sentence — `**Drives →** A, B, C` is canonical, never `**Drives** → A, B, C` or `Drives -> A, B, C`.
|
|
37
|
+
|
|
38
|
+
**Section-header form.** Every artifact carrying bindings emits a `## Bindings (§0.j five-direction)` section with one bullet per direction:
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
## Bindings (§0.j five-direction)
|
|
42
|
+
|
|
43
|
+
- **Drives →** <enumeration of downstream targets, comma-separated or sub-bulleted>
|
|
44
|
+
- **Driven by ←** <enumeration of upstream triggers / gates>
|
|
45
|
+
- **Satisfies →** <enumeration of end-states / criteria>
|
|
46
|
+
- **Established by ↑** <enumeration of anchors / ratifications>
|
|
47
|
+
- **Cross-bound with ↔** <enumeration of sibling reinforcements> `rules/propagation.md` (propagation's reciprocity surface is operationalised through this rule's five-direction notation).
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
A direction with **no bindings** is omitted — a section with three populated and two absent directions is conformant (the absent ones read as "this element neither drives nor is gated beyond its own scope"). Placeholder entries (`- **Drives →** TBD`) are non-conformant per `rules/definitiveness.md`.
|
|
51
|
+
|
|
52
|
+
### 2. Reciprocity — The Half-Edge Failure Pattern
|
|
53
|
+
|
|
54
|
+
**Every binding is reciprocal.** When A declares `Drives → B`, B declares `Driven by ← A`. When A declares `Satisfies → criterion C`, C declares `Established by ↑ A`. The reciprocal back-pointer lives **at the other end of the edge**, not in the artifact that emitted the forward declaration.
|
|
55
|
+
|
|
56
|
+
**Half-edge failure pattern.** A binding declared in one direction without its reciprocal at the other end is a **half-edge**:
|
|
57
|
+
|
|
58
|
+
- `A: Drives → B` declared, but B has no `Driven by ← A` — half-edge.
|
|
59
|
+
- `A: Satisfies → C` declared, but C has no `Established by ↑ A` — half-edge.
|
|
60
|
+
- `A: Cross-bound with ↔ B` declared, but B has no `Cross-bound with ↔ A` — half-edge (the self-reciprocal direction is the only one that requires identical wording on both ends).
|
|
61
|
+
|
|
62
|
+
Half-edges are **structural failures**. The `binding-reciprocity-grep` matcher at `conformity/binding_reciprocity_grep.py` scans every emitted artifact, extracts every declared binding, and verifies the reciprocal back-pointer exists at the cited target. Half-edges produce HIGH-severity findings at the pre-emission gate per `rules/pre-emission-gate.md` row 10.
|
|
63
|
+
|
|
64
|
+
**Closure protocol.** A forward declaration lacking its reciprocal MUST gain the reciprocal in the **same change-set**. A patch adding `A: Drives → B` while B is unmodified is non-conformant — the patch updates B's `Driven by ←` line in the same change. Where the cited target is outside modifiable scope (a cross-repository reference, a vendor-controlled artifact), the citation declares the asymmetry: `Drives → <target> (one-way: target outside our control)` — the explicit one-way label is the documented escape hatch, never a default.
|
|
65
|
+
|
|
66
|
+
### 3. Phase-Execution Threading — Ordered Work Surfaces
|
|
67
|
+
|
|
68
|
+
Where the artifact describes ordered execution — a pipeline, a migration, a release process, a deployment, a research procedure, a sprint sequence — the bindings carry phase-execution threading:
|
|
69
|
+
|
|
70
|
+
- **Named.** Every phase has a stable identifier (`Phase 01`, `Sprint 3`, `Step 5`). Identifiers are anchor-bearing (Markdown headings the rest of the artifact can link to).
|
|
71
|
+
- **Numbered.** Order is explicit through the identifier's numeric component. Zero-padding (`01`, `02`, …, `10`, `11`) is conformant where the host's discovered convention is zero-padded; otherwise honor the host's pattern.
|
|
72
|
+
- **Anchor-bearing.** Every phase emits a heading the rest of the artifact references (`## Phase 01 — Discovery`). Internal cross-references use the heading's anchor, not free-text mentions.
|
|
73
|
+
- **Fully cited at both ends.** Every phase declares what it invokes (`Drives →` next phase, downstream consumers), what it advances (`Satisfies →` end-states), what gates it (`Driven by ←` prerequisite phases, standing gates), what it gates (the reciprocal `Driven by ←` declaration in the next phase). Both ends are populated; one-sided declarations are half-edges.
|
|
74
|
+
- **Standing gates marked.** Mandates active throughout the entire ordered execution (e.g., a CM-N or M-N rule that gates every phase, not just the first) are marked **explicitly** as standing — `Driven by ← (standing) <rule-citation>`. Standing gates are inherited by every phase by default; the explicit marking lets the reader distinguish phase-specific gates from ecosystem-wide ones.
|
|
75
|
+
|
|
76
|
+
### 4. The Bidirectional Binding Matrix — Appendix Discipline
|
|
77
|
+
|
|
78
|
+
Where the artifact's structure permits — multi-section specs, multi-phase plans, multi-element architectural documents, multi-rule rule sets — a **Bidirectional Binding Matrix** is appended summarizing the graph. The matrix surfaces drift the inline bindings cannot reveal at a glance.
|
|
79
|
+
|
|
80
|
+
**Matrix shape.** The matrix is a square table indexed by element identifier on both axs. Each cell records the binding direction from the row element to the column element, using the canonical symbols:
|
|
81
|
+
|
|
82
|
+
| | A | B | C | D |
|
|
83
|
+
|---|---|---|---|---|
|
|
84
|
+
| A | — | → | ↔ | ↑ |
|
|
85
|
+
| B | ← | — | → | — |
|
|
86
|
+
| C | ↔ | ← | — | → |
|
|
87
|
+
| D | ↓ | — | ← | — |
|
|
88
|
+
|
|
89
|
+
Reading the row: "A drives B; A is cross-bound with C; A is established by D." Reading the column: "B is driven by A; B drives C; B has no relation to D." The matrix's reciprocity invariant is mechanical — when row R, column C carries `→`, then row C, column R MUST carry `←`. When row R, column C carries `↔`, then row C, column R MUST carry `↔`. The diagonal is `—` (an element does not bind to itself; self-citation is not a binding).
|
|
90
|
+
|
|
91
|
+
**When the matrix is mandatory.** The matrix is mandatory when the artifact carries five or more bound elements AND at least one element binds to three or more peers. Below this threshold, inline bindings sections suffice (a sparse matrix adds no clarity). At or above it, the matrix is the canonical reciprocity-audit surface.
|
|
92
|
+
|
|
93
|
+
**Matrix placement.** The matrix lives in an `## Appendix — Bidirectional Binding Matrix` section near the artifact's tail, after the last substantive section but before the closing bindings citation (the artifact's own outward bindings live at the artifact's `## Bindings (§0.j five-direction)` section, separate from the inter-element matrix).
|
|
94
|
+
|
|
95
|
+
### 5. Maintenance Discipline — Bindings Are Persistent
|
|
96
|
+
|
|
97
|
+
Bindings are **persistently maintained**, not authored once and frozen:
|
|
98
|
+
|
|
99
|
+
- **Element rename.** When an element's identifier changes, every reciprocal back-pointer is updated in the same change. The `binding-reciprocity-grep` matcher catches stale citations.
|
|
100
|
+
- **Element removal.** When an element is removed, every reciprocal back-pointer pointing AT the removed element is removed in the same change. Dangling back-pointers (`Driven by ← <removed-element>`) are non-conformant.
|
|
101
|
+
- **Element split / merge.** When an element splits (one element becomes two), the original's bindings distribute to the new elements based on which new element inherits each binding's semantic. When elements merge, the union of their bindings becomes the merged element's bindings (deduplication required — two `Driven by ← X` declarations from the pre-merge elements collapse to one).
|
|
102
|
+
- **Cross-rule citations.** When a rule cites another rule (`Cross-bound with ↔ rules/<peer>.md`), the cited rule's `Cross-bound with ↔` section MUST cite this rule. The `binding-reciprocity-grep` matcher enforces the rule-set's bidirectional closure as part of the pre-emission gate.
|
|
103
|
+
|
|
104
|
+
## Disclosure surface
|
|
105
|
+
|
|
106
|
+
Every binding emission, update, or reciprocal closure is recorded in the disclosure ledger per `rules/disclosure-ledger.md`:
|
|
107
|
+
|
|
108
|
+
- `[Binding — emitted: <element>; direction: <Drives → | Driven by ← | Satisfies → | Established by ↑ | Cross-bound with ↔>; target: <peer>]` for new bindings.
|
|
109
|
+
- `[Binding — closed: half-edge between <element-A> and <element-B>; reciprocal added at <element-B> in the same change-set]` for half-edge closures.
|
|
110
|
+
- `[Binding — removed: <element>; reason: <element-removed | binding-no-longer-applies>; reciprocals updated at <peer-list>]` for binding removals.
|
|
111
|
+
- `[Binding — Matrix appended: <appendix-path>; element-count: <N>]` for matrix emissions.
|
|
112
|
+
|
|
113
|
+
## Failure tells
|
|
114
|
+
|
|
115
|
+
`See Section 3` with no reciprocal back-pointer in Section 3 (half-edge — Section 3 does not declare it is being seen-from). A migration step that depends on a prior step without declaring the dependency in its `Driven by ←` (half-edge in the prerequisite direction). A test that satisfies an unstated requirement (the test's `Satisfies →` cites a requirement that has no `Established by ↑` declaration). A bindings section using ASCII-only arrows (`->` instead of `→`) — notation drift. A bindings section listing only `Drives →` and `Cross-bound with ↔`, omitting `Driven by ←` and `Satisfies →` and `Established by ↑` despite the artifact clearly being gated, satisfying criteria, and established by upstream anchors (incomplete population). A `Cross-bound with ↔` citation where the cited peer's section omits the reciprocal `Cross-bound with ↔` (asymmetric self-reciprocal). A multi-phase plan where Phase 03's `Drives → Phase 04` is declared but Phase 04 has no `Driven by ← Phase 03` (phase-execution threading half-edge). An artifact with five elements, dense bindings (each element binds to three or more peers), and no Bidirectional Binding Matrix appendix (mandatory matrix omitted). A renamed element whose old identifier still appears as a citation target in another element's binding line (stale citation). An element removed from the artifact whose reciprocal back-pointers in peer elements were not removed (dangling back-pointer).
|
|
116
|
+
|
|
117
|
+
## Bindings (§0.j five-direction)
|
|
118
|
+
|
|
119
|
+
- **Drives →** ● Every substantive structural element across every emitted host-project artifact (the five-direction notation is the binding floor for every section, sub-section, contract, phase). ● The `## Bindings (§0.j five-direction)` section at every `rules/*.md` body. ● The phase-execution threading at every `<project-root>/.apothem/plans/*/MASTER-PLAN.md` and `phases/NN-topic/PHASE.md`. ● The Bidirectional Binding Matrix appendix at every spec / multi-element design document. ● The `binding-reciprocity-grep` mechanical matcher at `conformity/binding_reciprocity_grep.py` — operationalizes the §2 reciprocity invariant.
|
|
120
|
+
- **Satisfies →** ● the fifteen-mandate registry row **M10 — Bidirectional Binding**. ● the Pre-Emission Gate row 10 (M10 bidirectional-binding check).
|
|
121
|
+
- **Established by ↑** ● the fifteen-mandate registry (ratifies M10). ● the Pre-Emission Gate row 10. ● The ecosystem's existing practice — every `rules/*.md` already carries a `Bindings (§0.j five-direction)` section; this rule canonicalizes that practice rather than introducing it.
|
|
122
|
+
- **Gated by ←** ● The trivial-vs-non-trivial threshold (trivial linear artifacts without cross-references are exempt). ● `CLAUDE.md` always-loaded preamble. ● The path-filter declared in this rule's frontmatter (Markdown / docs / structural-artifact directories).
|
|
123
|
+
- **Cross-bound with ↔** ↔ `rules/visual-leverage.md` (M9 — diagram `cross-reference:` metadata is the diagram-side projection of the M10 reciprocal-binding surface). ↔ `rules/canonical-layout.md` (M12 — phase / sub-phase reporting binds producer / consumer / cross-references through M10 notation). ↔ `rules/disclosure-ledger.md` (M2 — binding emissions / closures / removals are recorded in the ledger). ↔ `rules/pre-emission-gate.md` (M4 — bar 10 of the gate enforces this rule's reciprocity invariant via the mechanical matcher). ↔ `rules/definitiveness.md` (M8 — placeholder bindings like `Drives → TBD` violate both this rule's reciprocity discipline and M8's closure-of-open-markers discipline). ↔ `rules/token-efficiency-rewrite.md` (L3 anchor loss is a half-edge failure on the same axis as §2 reciprocity).
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "canonical-layout-reporting-tiers"
|
|
3
|
+
description: "Path-filtered companion rule carrying the operational depth of `rules/canonical-layout.md` — the two-tier reporting body (per-sub-phase + phase rollup), the numeric-prefix discipline, the orphan-output recovery surface, the reciprocal producer / consumer cross-reference body, the surface-imposition table, and the M11 ↔ M12 correspondence table; demand-loaded on plan-suite / phase / migration touches."
|
|
4
|
+
pathFilter: "**/.apothem/plans/**, **/.plans/**, **/phases/**, **/REPORT.md, **/PHASE.md, **/MASTER-PLAN.md, **/PROGRESS.md, **/migrations/**"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
9
|
+
|
|
10
|
+
# Rule: Canonical Layout — Reporting Tiers & Operational Body (Companion Sub-Rule)
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Carry the operational depth of the canonical-layout discipline declared at the parent `rules/canonical-layout.md` rule. Path-filtered: loads on any per-suite plan artifact, per-phase artifact, per-sub-phase report, migration script, or progress / master-plan singleton. The parent owns the M12 standing directive and the per-section summaries; this companion owns each section's full body — §1 two-tier reporting, §2 canonical layout, §2.1 numeric-prefix discipline, §2.2 `_outputs/`, §2.3 anti-inflation, §2.4 maintenance suites, §3 orphan prevention, §4 reciprocal cross-references, §5 surface imposition, §6 M11 ↔ M12 correspondence, §7 three-tier scalability (D7).
|
|
15
|
+
|
|
16
|
+
## Obligations
|
|
17
|
+
|
|
18
|
+
### 1. Two-Tier Reporting — Per-Sub-Phase + Phase Rollup
|
|
19
|
+
|
|
20
|
+
#### 1.1 Per-Sub-Phase Report (Working Tier)
|
|
21
|
+
|
|
22
|
+
Every sub-phase produces a report at the sub-phase folder's canonical filename (`REPORT.md` is the plan-suite convention; the host's discovered convention overrides per M1). This is the **working tier** — fine-grained, as-it-happens, capturing the sub-phase's substantive work.
|
|
23
|
+
|
|
24
|
+
Canonical sections:
|
|
25
|
+
|
|
26
|
+
- **Summary** — one-paragraph statement of what the sub-phase produced.
|
|
27
|
+
- **Tasks executed** — enumeration of tasks completed, mapped to the sub-phase's `PHASE.md` task list.
|
|
28
|
+
- **Outputs emitted** — every artifact produced, with path, line count or size, and a one-line description.
|
|
29
|
+
- **Verification results** — every per-sub-phase verification item with its outcome.
|
|
30
|
+
- **Disclosure ledger** — the sub-phase's amendments, extensions, refinements, deferrals, defaults, and inquiry outcomes per `rules/disclosure-ledger.md`.
|
|
31
|
+
- **Pre-emission gate attestation** — the fifteen-bar attestation per `rules/pre-emission-gate.md`.
|
|
32
|
+
- **Bindings (§0.j five-direction)** — reciprocal cross-references per `rules/bidirectional-binding.md`.
|
|
33
|
+
|
|
34
|
+
#### 1.2 Phase-Level Rollup Report (Reviewing Tier)
|
|
35
|
+
|
|
36
|
+
Every phase produces a rollup report aggregating across its sub-phases — the **reviewing tier**: derivative, condensed, cross-cutting.
|
|
37
|
+
|
|
38
|
+
**The rollup is NOT a concatenation of sub-phase report links.** A document that lists the sub-phase reports as bullets and stops is non-conformant. The rollup carries five required behaviors:
|
|
39
|
+
|
|
40
|
+
1. **Summarizes each sub-phase's outputs in a uniform template.** Each sub-phase gets the same shape — same headings, same fields, same reading order. Heterogeneous sub-phase summaries (one verbose, another a stub, a third in a different format) violate the uniform-template requirement.
|
|
41
|
+
2. **Aggregates metrics across sub-phases.** Counts (artifacts emitted, lines authored, tests passed, verifications cleared), durations (sub-phase elapsed time, sprint velocity per `rules/agile-sprints.md` §1.7), trajectories (defect rate, churn, finding density) are aggregated and presented at the phase level.
|
|
42
|
+
3. **Surfaces phase-level patterns invisible at any single sub-phase.** Patterns that emerge only across sub-phases — recurring failure modes, convergent decisions, drift between sub-phases — are surfaced explicitly. The phase-level pattern surface is the rollup's **unique** value over per-sub-phase concatenation.
|
|
43
|
+
4. **Carries a phase-level self-check.** The rollup runs the pre-emission gate at the **phase level**, not just the per-sub-phase level. The phase's own bindings, the phase's own definitiveness, the phase's own production-readiness are inspected as a whole.
|
|
44
|
+
5. **Advances the phase's outward declarations on behalf of the whole phase.** The rollup commits the phase's outputs to the phase's downstream consumers — the next phase's inputs, the parent suite's progress tracker, the host's index registries.
|
|
45
|
+
|
|
46
|
+
The rollup's filename convention follows the host's discovery; the established plan-suite convention is `phases/NN-topic/REPORT.md` (the parent phase's `REPORT.md` at the parent folder), with sub-phases at `phases/NN-topic/NNL-subtopic/REPORT.md`. Single-sub-phase phases collapse the tier — the per-sub-phase report IS the rollup.
|
|
47
|
+
|
|
48
|
+
### 2. Canonical Layout — Predictable Locations with Provenance
|
|
49
|
+
|
|
50
|
+
Generated outputs sit at **predictable, canonical locations** with provenance and reciprocal cross-references. The exact form of "canonical" — directory naming, filename conventions, structural-marker prefixes, per-directory index conventions — is **delegated to the host's discovered conventions** per `rules/host-discovery.md`. Where the host is silent on layout, the choice surfaces as an inquiry per `rules/authority-inquiry.md` with apothem's recommendation per `rules/option-annotation.md`.
|
|
51
|
+
|
|
52
|
+
**No artifact is laid as a flat file at an ad-hoc location.** Every emitted output has:
|
|
53
|
+
|
|
54
|
+
- A **canonical directory** the host has ratified for outputs of its kind (e.g., test files under the host's tests directory; documentation pages under the host's docs directory; CI workflows under `.github/workflows/`; migration scripts under the host's migrations directory).
|
|
55
|
+
- A **filename matching the host's sibling convention** (kebab-case / snake_case / PascalCase / etc. — whatever the siblings use).
|
|
56
|
+
- A **provenance record** — either embedded in the artifact (frontmatter, header comment, docstring) or recorded in the producer's report. Every emitted artifact answers "where did this come from?" by inspection.
|
|
57
|
+
- An **index entry** in the enclosing directory's index where the host maintains one (`__init__.py`, `index.md`, TOC, sidebar, package manifest).
|
|
58
|
+
|
|
59
|
+
Cross-phase artifacts — synthesizing across phases — sit at the host's designated cross-phase deliverable location (whatever the host's convention is), indexed in the enclosing directory's index, with reciprocal back-references from every phase that contributed.
|
|
60
|
+
|
|
61
|
+
### 2.1 Numeric-Prefix Discipline — Ordering Sequences Only
|
|
62
|
+
|
|
63
|
+
Numeric prefixes on filesystem paths (`00-`, `01-`, `02-`, `NN-`) **convey ordering**. The discipline scopes them to artifacts whose **sequence is intrinsic to the contract**:
|
|
64
|
+
|
|
65
|
+
- **Phase-ordering folders** under `phases/` (`phases/00-discovery/`, `phases/01-foo/`, `phases/02-bar/`) — the prefix carries the ordering the phase apparatus depends on. The `NN-` prefix is mandatory on every phase folder.
|
|
66
|
+
- **Sub-phase folders** under a parent phase (`phases/02-foo/02A-subtopic/`, `02B-subtopic/`) — the prefix-plus-letter carries the sub-phase ordering. Mandatory.
|
|
67
|
+
- **Migration scripts** where the host orders by numeric prefix (`migrations/0042_user_schema.sql`) — honor the host's ratified scheme.
|
|
68
|
+
- **Any other artifact class where the host has ratified ordinal-prefix naming** as a convention — discovered per `rules/host-discovery.md` and honored.
|
|
69
|
+
|
|
70
|
+
**Numeric prefixes are forbidden on artifacts that have no sibling sequence** — root-level singletons, lone configuration files, top-of-suite infrastructure files. Adding a prefix to a file that has no `01-` / `02-` siblings is **meaningless decoration that mis-signals an ordering relationship that does not exist**, and is a structural failure on the same axis as the orphan-output failure at §3.
|
|
71
|
+
|
|
72
|
+
**Suite-root infrastructure files** at every plan-suite root (`<project-root>/.apothem/plans/{suite}/`) — the suite preamble, the master index, the progress tracker, the plan-notes ledger, the completion attestation, every other root-level singleton — carry **no numeric prefix**. They are siblings of one another, not items in an ordered sequence; the prefix would falsely imply an ordering the contract does not require. The same discipline extends to **any new root-level singleton class** the ecosystem admits in the future: the prefix appears only where ordering is intrinsic, never as decoration.
|
|
73
|
+
|
|
74
|
+
**Failure tells.** A `00-FOO.md` at any root level where there is no `01-FOO.md` sibling is a finding. A renamed file gaining the prefix when its prior sibling-set never carried one is a finding. A new artifact class whose first instance is `00-X.md` ratifies a prefix the second instance (`01-X.md`?) would have to honor — preferable: drop the prefix on the first instance unless ordering is genuinely intrinsic.
|
|
75
|
+
|
|
76
|
+
### 2.2 Plan-Suite `_outputs/` Emission Surface
|
|
77
|
+
|
|
78
|
+
Every plan suite may carry a suite-local `_outputs/` sibling beside `_inputs/`, `_spec/`, and `phases/`. `_outputs/` is the canonical home for durable generated emissions that are useful after the session but too detailed for PROGRESS.md or PLAN-NOTES.md: audit reports, report mirrors, rollups, metrics, exports, and bounded operator-facing summaries.
|
|
79
|
+
|
|
80
|
+
Placement discipline:
|
|
81
|
+
|
|
82
|
+
- `/plan-audit` writes bounded audit reports to `<suite>/_outputs/audit-report-<YYYY-MM-DD>.md`.
|
|
83
|
+
- `/plan-execute` writes phase implementation reports at `phases/NN-topic/REPORT.md` and may mirror operator-facing summaries at `<suite>/_outputs/<phase-slug>/REPORT.md`.
|
|
84
|
+
- `/plan-review` keeps scorecards and concise findings state in PLAN-NOTES.md, but durable large review reports or revision-impact detail maps move to `_outputs/` with backlinks.
|
|
85
|
+
- `/plan-status` remains read-only; if another orchestrator persists its prose output, that file belongs under `_outputs/report-<YYYY-MM-DD>.md` unless the host has a more specific documentation surface.
|
|
86
|
+
|
|
87
|
+
Every `_outputs/` artifact must carry producer attribution and a consumer/index reference: the producer report's `Outputs emitted` section, PROGRESS.md Phase Output Registry, a local README/index if the suite maintains one, or the Handoff Manifest. `_outputs/` artifacts are evidence, not authoritative requirements; requirement traceability still resolves to the suite specification, MASTER-PLAN.md, PHASE.md, or operator-ratified decisions.
|
|
88
|
+
|
|
89
|
+
### 2.3 Anti-Inflation Reporting Discipline
|
|
90
|
+
|
|
91
|
+
PROGRESS.md and PLAN-NOTES.md are bounded state ledgers, not storage for every detail. They use index-first summaries and backlink to reports:
|
|
92
|
+
|
|
93
|
+
- PROGRESS.md records current status, counters, blocker summaries, Phase Output Registry rows, Resumption Contract, next action, and critical file manifests. It does not accumulate long chronological narratives or paste full verification logs.
|
|
94
|
+
- PLAN-NOTES.md records durable decisions, scorecard summaries, open questions, waivers, and rationale. It uses rolling summaries when a section grows beyond the current decision horizon.
|
|
95
|
+
- REPORT.md and `_outputs/` hold detailed task logs, verification transcripts, audit reports, metrics, and long evidence tables.
|
|
96
|
+
|
|
97
|
+
When a workflow produces detailed evidence, the same change-set writes the detail to REPORT.md or `_outputs/`, then writes a concise PROGRESS.md / PLAN-NOTES.md backlink. The backlink is the state surface; the report is the evidence surface.
|
|
98
|
+
|
|
99
|
+
### 2.4 `*-maintenance` Suite Pattern
|
|
100
|
+
|
|
101
|
+
Deferred, incomplete, or out-of-scope work that would inflate the active suite routes to a sibling maintenance suite named `<suite>-maintenance`. Maintenance routing is for work that the originating suite should not execute now, not for hiding open findings required by the current gate.
|
|
102
|
+
|
|
103
|
+
Each maintenance item carries:
|
|
104
|
+
|
|
105
|
+
- Source suite path and source artifact anchor.
|
|
106
|
+
- Finding or task ID.
|
|
107
|
+
- Rationale for maintenance routing.
|
|
108
|
+
- Expected downstream command or phase.
|
|
109
|
+
- Current status and owner, if known.
|
|
110
|
+
|
|
111
|
+
The originating suite records only a concise maintenance backlink in PLAN-NOTES.md or PROGRESS.md. The maintenance suite carries the expanded backlog and its own `_spec/`, `_inputs/`, `_outputs/`, and `phases/` surfaces when it becomes executable.
|
|
112
|
+
|
|
113
|
+
### 3. Orphan Output Prevention
|
|
114
|
+
|
|
115
|
+
An **orphan output** is a generated artifact that satisfies any of:
|
|
116
|
+
|
|
117
|
+
- **No consumer.** Nothing in the host's reference graph reads, imports, executes, links to, or references the artifact.
|
|
118
|
+
- **No index entry.** The artifact is not listed in its enclosing directory's index where the host maintains one.
|
|
119
|
+
- **No producer attribution.** The artifact carries no provenance — no frontmatter `provenance:` field, no header comment naming the producer, no record in the producer's report.
|
|
120
|
+
|
|
121
|
+
Orphan outputs are **structural failures**. The `orphan-output-grep` mechanical matcher at `conformity/orphan_output_grep.py` scans every emitted artifact's enclosing directory for index-entry presence and the producer's report for attribution presence. Orphan findings are HIGH-severity at the pre-emission gate per `rules/pre-emission-gate.md` row 12.
|
|
122
|
+
|
|
123
|
+
**Orphan recovery.** When an orphan is detected:
|
|
124
|
+
|
|
125
|
+
- **Add the consumer.** If the artifact is genuinely needed but no consumer exists, surface the gap as a finding for the user's decision (the artifact's existence is justifiable but its consumer is missing).
|
|
126
|
+
- **Add the index entry.** Update the enclosing directory's index in the same change-set. The index update is part of the artifact's emission, not a follow-up.
|
|
127
|
+
- **Add the producer attribution.** Update the producer's report to record the artifact's emission. Update the artifact's frontmatter / header to cite the producer.
|
|
128
|
+
- **Retire the artifact.** When investigation reveals the artifact has no genuine consumer, it is retired in the same change-set rather than left as an orphan. Retirement routes through the destructive-op confirmation surface at `rules/interactive-questions.md` §6.4 (the canonical Delete option set).
|
|
129
|
+
|
|
130
|
+
### 4. Reciprocal Producer / Consumer Cross-References
|
|
131
|
+
|
|
132
|
+
Every emitted output carries reciprocal cross-references on both ends of every producer / consumer edge:
|
|
133
|
+
|
|
134
|
+
- **Producer side.** The phase's report (per-sub-phase or rollup) lists the artifact in its `Outputs emitted` section with the artifact's path, the consumer(s) that depend on it, and the binding direction (`Drives → <consumer>`).
|
|
135
|
+
- **Consumer side.** Every artifact that consumes the output references it explicitly. For code, this is an import / require / link. For documentation, this is a Markdown link or include. For configuration, this is a path reference. The consumer's reference IS the reciprocal back-pointer per `rules/bidirectional-binding.md`.
|
|
136
|
+
|
|
137
|
+
When an output's consumer changes (added, removed, renamed), the producer's report is updated in the same change-set. Stale producer reports (claiming a consumer that no longer exists, omitting a new consumer) are findings.
|
|
138
|
+
|
|
139
|
+
### 5. Surface Imposition — Where the Layout Discipline Lands
|
|
140
|
+
|
|
141
|
+
| Surface | Layout obligation |
|
|
142
|
+
|---|---|
|
|
143
|
+
| `CLAUDE.md` | Carries the standing directive that non-trivial multi-step work lays outputs under the canonical layout with two-tier reporting (M12 row in §8 fifteen-mandate registry). |
|
|
144
|
+
| `skills/*/SKILL.md` | Procedures spanning sub-phases specify the sub-phase partitioning and the expected reports; per-sub-phase report shape is declared in the procedure. |
|
|
145
|
+
| `agents/*.md` | Agents with multi-artifact remits return a work-root path with the canonical layout populated. The return format includes the per-sub-phase reports and the rollup. |
|
|
146
|
+
| `commands/*.md` | Commands declare their place in the host's pipeline conventions. Each command's outputs section names the canonical layout the command honors. |
|
|
147
|
+
| Multi-phase plans at `<project-root>/.apothem/plans/*/` | Each phase folder follows `phases/NN-topic/{REPORT.md, NNL-subtopic/}` shape. Sub-phase folders follow `phases/NN-topic/NNL-subtopic/{PHASE.md, REPORT.md, …}` shape. Cross-phase synthesis sits at the suite-root level (`MASTER-PLAN.md`, `PREAMBLE.md`, `PROGRESS.md`, `PLAN-NOTES.md`); durable generated emissions sit under `_outputs/`. |
|
|
148
|
+
| Hook scripts at `conformity/` | The `orphan-output-grep` and the `non-canonical-location-grep` matchers operationalize §3 and §2 respectively at the pre-emission gate. |
|
|
149
|
+
|
|
150
|
+
### 6. The M11 ↔ M12 Correspondence
|
|
151
|
+
|
|
152
|
+
The sprint apparatus per `rules/agile-sprints.md` and the layout / reporting discipline here are **mutually-reinforcing**. The correspondence:
|
|
153
|
+
|
|
154
|
+
| Sprint apparatus element (M11) | Layout / reporting surface (M12) |
|
|
155
|
+
|---|---|
|
|
156
|
+
| Sprint Goal | The phase / sub-phase folder's `PHASE.md` Goal section |
|
|
157
|
+
| Sprint Backlog | The phase / sub-phase folder's Tasks section |
|
|
158
|
+
| Definition of Ready | Pre-conditions checklist in the per-sub-phase report's preamble |
|
|
159
|
+
| Definition of Done | Verification section in the per-sub-phase report |
|
|
160
|
+
| Sprint Review | The rollup report's per-sub-phase summaries with approve / reject / carry-forward outcomes |
|
|
161
|
+
| Sprint Retrospective | The rollup report's pattern-surfacing section + retrospective subsection |
|
|
162
|
+
| Velocity tracking | Aggregated metrics in the rollup report (artifacts emitted, items completed per sub-phase) |
|
|
163
|
+
|
|
164
|
+
The mapping is the operational form of the M11 Agile-process discipline materialized at the M12 layout / reporting surface. A non-trivial multi-step work session that satisfies M11 without populating the corresponding M12 surface is non-conformant; a session that satisfies M12 without the M11 apparatus is equally non-conformant.
|
|
165
|
+
|
|
166
|
+
### 7. Three-Tier Scalability Framework (D7)
|
|
167
|
+
|
|
168
|
+
The two-tier reporting discipline at §1 governs intra-phase / intra-suite reporting; this section governs inter-suite scalability — how the layout, validation cadence, indexing, and decomposition heuristics shift as a plan suite grows from a few dozen phases to thousands.
|
|
169
|
+
|
|
170
|
+
#### 7.1 Tier Table
|
|
171
|
+
|
|
172
|
+
| Tier | Phase count | Spec count | Validation cadence | Indexing | Decomposition |
|
|
173
|
+
|---|---|---|---|---|---|
|
|
174
|
+
| `small` | <50 | <100 | Full-suite each pass — `/plan-review` audits every phase, every spec section, every constraint per cycle | In-line refs (PLAN-NOTES.md narrative trace tables) | Monolithic — single suite at `<project-root>/.apothem/plans/{suite}/` |
|
|
175
|
+
| `medium` | 50–500 | 100–1000 | Incremental + sampled-rollup — per-phase validation continues, plus phase-group rollups (5–20 phases each) sampled per cycle | Suite-root `MASTER-INDEX.md` per `src/apothem/templates/master-index-template.md` | Phase-grouped — `phases/NN-group/NNL-phase/` two-level shape, groups of 5–20 phases |
|
|
176
|
+
| `large` | ≥500 | ≥1000 | Index-driven + on-demand drilldown — `MASTER-INDEX.md` is queried first, sub-suite REPORTs read on demand | `MASTER-INDEX.md` per sub-suite + suite-of-suites parent index | Sub-suite federation — multiple plan suites with parent-child relationship; each child suite is small or medium |
|
|
177
|
+
|
|
178
|
+
#### 7.2 Drift-Prevention Mechanisms
|
|
179
|
+
|
|
180
|
+
| Mechanism | Tier applicability | Description |
|
|
181
|
+
|---|---|---|
|
|
182
|
+
| Trace matrix | All tiers | Every spec requirement maps to one or more phases; every phase maps to one or more spec requirements. Bidirectional. At small tier, narrative trace tables inside the plan suite's notes file substitute for the formal trace-matrix file; at medium+ tier, `src/apothem/templates/trace-matrix-template.md` is materialized at the suite root. |
|
|
183
|
+
| Stable IDs | medium+ | Cross-references use stable IDs (`R-NNNN` for requirements; `P-NN` for phases) so renames do not break refs. |
|
|
184
|
+
| `MASTER-INDEX.md` | medium+ | Suite-root index of every phase + every spec section + every constraint + every named decision per `src/apothem/templates/master-index-template.md`. |
|
|
185
|
+
| Sub-suite federation | large | Plan decomposes into multiple plan suites with parent-child relationship; each child suite is small or medium; the parent index aggregates. |
|
|
186
|
+
| Per-phase verification | All tiers | Every phase emits a per-phase REPORT.md per §1.1. |
|
|
187
|
+
| Phase-rollup verification | medium+ | Every group of 5–20 phases emits a rollup REPORT per §1.2. |
|
|
188
|
+
| Suite-rollup verification | large | Every child suite emits a final rollup; federation aggregates child-suite rollups at the parent. |
|
|
189
|
+
|
|
190
|
+
#### 7.3 Borderline-Tier Inquiry
|
|
191
|
+
|
|
192
|
+
When a plan suite's phase count sits within ±10% of a tier boundary (45–55 phases for the small/medium boundary; 450–550 phases for the medium/large boundary), the agent MUST surface a tier-classification choice through the structured-inquiry channel per `rules/authority-inquiry.md` (preference category) rather than silent-pick. Question shape: `Plan suite phase count is within ±10% of a tier boundary; which scalability tier should govern this suite?`; header `Tier`; options `Small / Medium / Large` each with three-segment body citing the boundary thresholds and any host-discoverable prior-suite tier conventions per `rules/host-discovery.md`; `default-pointer:` `no-default: user decision required` (long-lived ratification per the §7.2 stable-ID convention; silent default would commit the suite to a tier without the operator's awareness of boundary proximity).
|
|
193
|
+
|
|
194
|
+
#### 7.4 Small-Tier Worked Example
|
|
195
|
+
|
|
196
|
+
The `sample-overhaul` plan suite at `<project-root>/.apothem/plans/sample-overhaul/` is a worked small-tier example: 24 PHASE.md files (well under the 50-phase boundary) governed by full-suite validation per cycle, in-line cross-references inside `PLAN-NOTES.md`, and a monolithic single-suite layout at the suite root. No `MASTER-INDEX.md` is materialized; no formal trace-matrix file is produced; the narrative trace tables inside `PLAN-NOTES.md` carry the all-tier trace-matrix obligation at the small-tier alternative form.
|
|
197
|
+
|
|
198
|
+
#### 7.5 Tier Transition
|
|
199
|
+
|
|
200
|
+
When a small-tier suite grows past the 50-phase boundary (or a medium-tier suite past 500), the transition is a deliberate operator decision routed through `/plan-review` plus a tier-classification structured inquiry. The transition emits the medium-tier (or large-tier) infrastructure in the same change-set: `MASTER-INDEX.md` materialized, stable IDs assigned to existing phases / requirements, trace-matrix file produced per `src/apothem/templates/trace-matrix-template.md`, sub-suite federation laid out (large only). Silent transitions are non-conformant — a 51-phase suite with no `MASTER-INDEX.md` is a structural failure on the same axis as a missing per-phase REPORT.md.
|
|
201
|
+
|
|
202
|
+
## Enforcement
|
|
203
|
+
|
|
204
|
+
Path-filtered (the eight glob patterns in this rule's `pathFilter` field — `**/.apothem/plans/**`, `**/.plans/**`, `**/phases/**`, `**/REPORT.md`, `**/PHASE.md`, `**/MASTER-PLAN.md`, `**/PROGRESS.md`, `**/migrations/**`), always-on at every seriousness level when in scope. Demand-loaded companion to `rules/canonical-layout.md`: the parent owns the M12 standing directive and per-section summaries; this companion owns the operational bodies for §1 two-tier reporting, §2 / §2.1 layout and numeric-prefix discipline, §2.2 `_outputs/`, §2.3 anti-inflation, §2.4 maintenance suites, §3 orphan-output recovery, §4 reciprocal cross-references, §5 surface imposition, §6 M11 ↔ M12 correspondence, and §7 three-tier scalability (D7).
|
|
205
|
+
|
|
206
|
+
## Bindings (§0.j five-direction)
|
|
207
|
+
|
|
208
|
+
- **Drives →** ● Every sub-phase `REPORT.md` body across every plan suite (§1.1 canonical-sections list). ● Every phase rollup `REPORT.md`'s five required behaviors (§1.2 — uniform template, aggregate metrics, surface patterns, phase-level self-check, advance outward declarations). ● Every phase folder's `NN-` prefix and every sub-phase folder's `NNL-` suffix (§2 numeric-prefix discipline). ● Every `_outputs/` durable emission and anti-inflation backlink (§2.2-§2.3). ● Every `*-maintenance` suite routing (§2.4). ● Every orphan-recovery action (§3 — add consumer / add index entry / add producer attribution / retire). ● Every producer-side / consumer-side reciprocal cross-reference closure (§4). ◐ The `orphan-output-grep` mechanical matcher at `conformity/orphan_output_grep.py`.
|
|
209
|
+
- **Satisfies →** ● the fifteen-mandate registry row **M12 — Phase Reporting & Canonical Layout** (operational depth tier; standing-directive tier is the parent rule). ● `rules/canonical-layout.md` per-section anchors (each anchor's `(Companion Sub-Rule Anchor)` pointer line resolves to a section here).
|
|
210
|
+
- **Established by ↑** ● `rules/canonical-layout.md` (parent rule; this companion carries the operational depth the parent's anchors point to). ● the fifteen-mandate registry (ratifies M12). ● the Pre-Emission Gate row 12.
|
|
211
|
+
- **Gated by ←** ● The path-filter (the seven glob patterns) — this rule demand-loads only on plan-suite / phase / migration artifact touches. ● `rules/canonical-layout.md` always-on baseline (parent rule must be live for the per-section anchors to surface and resolve here). ● The trivial-vs-non-trivial threshold (trivial-scope work bypasses the two-tier requirement; this rule's body never engages).
|
|
212
|
+
- **Cross-bound with ↔** ↔ `rules/canonical-layout.md` (parent rule; per-section anchors bind this companion). ↔ `rules/agile-sprints.md` (M11 — the §6 M11 ↔ M12 correspondence table is the mutual-reinforcement surface; sprint apparatus and layout / reporting surface bind both ways). ↔ `rules/bidirectional-binding.md` (M10 — §4 reciprocal producer / consumer cross-references operationalize M10 reciprocity at the artifact layer). ↔ `rules/host-discovery.md` (M1 — §1.1 / §1.2 / §2 honor host-discovered conventions for filenames and prefix schemes). ↔ `rules/pre-emission-gate.md` (M4 — bar 12 enforces this rule's two-tier + canonical-layout + orphan-prevention invariants). ↔ `rules/disclosure-ledger.md` (M2 — output / report / orphan-resolution emissions are recorded in the parent's ledger). ↔ `rules/interactive-questions.md` (§6.4 destructive-op canonical option set governs §3's orphan-retirement path; §7.3 borderline-tier inquiry routes through the canonical channel). ↔ `src/apothem/templates/master-index-template.md` (medium+ tier suite-root index per §7.2). ↔ `src/apothem/templates/trace-matrix-template.md` (all-tier trace-matrix surface per §7.2; small tier substitutes a narrative trace table in the plan suite's notes file).
|