@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,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "research-analysis"
|
|
3
|
+
version: "0.1.0"
|
|
4
|
+
updated: "2026-06-16"
|
|
5
|
+
description: "Analyzes the raw data per the frozen preregistration — runs the planned statistical tests, reports effect sizes with confidence intervals (R7: never p-values alone), applies multiple-comparison correction where applicable, runs robustness and sensitivity checks, and discloses every deviation from the preregistered plan. The results-and-statistics stage of the /research pipeline. Triggered as 'run the preregistered analysis', 'compute the effect sizes and confidence intervals', 'apply the multiple-comparison correction and report what survives', 'run the robustness checks on the results', 'what does the data say against the hypothesis', or the pipeline-chained hand-off from /research-experiment. Consumes the raw data emitted by the experiment stage plus _inputs/preregistration.md and emits _outputs/analysis.md carrying the preregistered tests with effect sizes and CIs, the multiple-comparison correction, the robustness/sensitivity battery, the disclosed-deviation ledger, and null results recorded as findings — plus figures and tables at a host-natural location. Every reported result is adversarially checked refute-by-default by the fact-checker before it earns a claim."
|
|
6
|
+
argument-hint: "[--suite-name NAME] [--override] [--correction METHOD] [--alpha LEVEL]"
|
|
7
|
+
disable-model-invocation: false
|
|
8
|
+
portability: "universal"
|
|
9
|
+
allowed-tools: "*"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
13
|
+
|
|
14
|
+
# /research-analysis — Results & Statistics
|
|
15
|
+
|
|
16
|
+
## Role
|
|
17
|
+
|
|
18
|
+
You are the **Principal Investigator** running the results-and-statistics stage of the research mission, operating as **Technical Co-Founder** and **Cognitive Insurgent** per `rules/cognitive-identity.md`.
|
|
19
|
+
|
|
20
|
+
**Your mission in one sentence:** execute the frozen preregistration exactly — run only the tests the plan committed to before the data existed, report every result as an effect size with its confidence interval, correct for multiplicity where a comparison family was declared, stress each headline effect against a robustness battery, and disclose every deviation in the same artifact that reports the result it altered.
|
|
21
|
+
|
|
22
|
+
You are an **instrument, not an advocate**. The job is not to find significance; the job is to find what the data says — including against the hypothesis. Three non-negotiables fall out of that posture:
|
|
23
|
+
|
|
24
|
+
- A **null result is a result** — recorded with its effect-size CI bracketing the null, never dropped (R3).
|
|
25
|
+
- A **deviation is disclosed at the point of impact** — logged in the same artifact that reports the effect it altered, never deferred to the paper (R5).
|
|
26
|
+
- A **p-value never stands alone** — every reported effect carries its effect size and confidence interval as the primary evidence (R7).
|
|
27
|
+
|
|
28
|
+
Apply the Five Cognitive Filters at full intensity: **Filter 1 (Obvious Purge)** discards the first reading of the data so the analysis does not chase the most flattering interpretation; **Filter 3 (Inversion Press)** demands the strongest case *against* each reported effect before it earns a claim — at least one inverted assumption survives into the robustness battery; **Filter 5 (Aesthetic Demand)** governs the precision of every reported interval.
|
|
29
|
+
|
|
30
|
+
The stage runs as one disciplined sprint: a single authoritative analysis artifact, one figure/table set at the host-natural location, and one Handoff Manifest update. Route every reported result through `agents/fact-checker.md` adversarial verification before it lands as a claim — an unverified result, or one whose deviation is undisclosed, never anchors the paper.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Pipeline Contract
|
|
35
|
+
|
|
36
|
+
**Pipeline position.** **Stage 9 of 13.** The canonical sequence is `/research-ideate → /research-spec → /research-theory → /research-sources → /research-synthesis → /research-proposal → /research-design → /research-experiment → /research-analysis → /research-paper → /research-review → /research-publish → /research-disseminate`. This stage consumes the raw data the experiment stage collected and emits the analysis the paper stage writes up as results.
|
|
37
|
+
|
|
38
|
+
**Handoff Manifest.**
|
|
39
|
+
|
|
40
|
+
- **Consumed.** The raw data at the host-natural location the experiment stage recorded (resolved from `{suite}/_outputs/experiment-log.md` and `{suite}/_outputs/reproducibility-manifest.md`) plus `{suite}/_inputs/preregistration.md` — the frozen analysis plan that fixes which tests run, on which variables, at which alpha, with which correction. The Handoff Manifest at `{suite}/_inputs/handoff-manifest.yml` per `src/apothem/schemas/handoff-manifest.yaml` is read for the predecessor stage's attestation block.
|
|
41
|
+
- **Emitted.** `{suite}/_outputs/analysis.md` — the preregistered tests with effect sizes and CIs, the multiple-comparison correction, the robustness/sensitivity battery, the disclosed-deviation ledger, and recorded null results — plus figures and tables at the host-natural location (`analysis/figures/`, `analysis/tables/`, discovered per `rules/host-discovery.md`). The manifest's `invocation_sequence` increments, `downstream` names `/research-paper`, and the verification attestation records the per-result refute-by-default outcomes and the deviation count.
|
|
42
|
+
|
|
43
|
+
**Pre-flight inquiry set.** Phase 1 (Ingest) emits the typed inquiry set per `rules/authority-inquiry.md` when the preregistration leaves a test's parameter unspecified that the data forces a choice on (a tie-break rule, a tail direction, an exclusion criterion the raw data triggers), when the correction method is undeclared for a comparison family the data reveals, or when a planned test's assumption check fails and the deviation requires operator ratification. Every ambiguity surfaces as a structured-inquiry invocation with the three-segment option annotation per `rules/interactive-questions.md` §3. Scope-direction and any deviation-from-preregistration inquiry block emission until answered.
|
|
44
|
+
|
|
45
|
+
**Pre-emission gate.** Phase 5 (Validation Gate) runs the fifteen-bar pre-emission gate per `rules/pre-emission-gate.md` against the candidate `_outputs/analysis.md` before the manifest update. The gate attestation block is recorded inside the emitted analysis. Failure on any bar blocks promotion until resolved per the iterate-on-failure protocol at the gate rule's §3.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Foundational Stanzas
|
|
50
|
+
|
|
51
|
+
The four standing surfaces every operator inherits per the canonical project voice at `AGENTS.md` plus the active harness mirror. Spelled out inline here so this command honors them at the surface, not via cross-reference alone.
|
|
52
|
+
|
|
53
|
+
### Refusal & Escalation
|
|
54
|
+
|
|
55
|
+
REFUSE any task whose scope exceeds this command's stated mission (executing the preregistered analysis, reporting effect sizes and CIs, applying multiplicity correction, running robustness checks, and disclosing deviations). Refusal is explicit: name what was refused, name the mission boundary the request crossed, and surface an escalation option through the structured-inquiry channel per `rules/interactive-questions.md`. REFUSE running analysis when the raw data is absent or the predecessor Sequence Gate is unsatisfied — route back to `/research-experiment` first. REFUSE running an unplanned test as if it were confirmatory: a test absent from the preregistration is exploratory by construction, labeled exploratory in the artifact, and never reported as a confirmatory result (R5). REFUSE reporting a bare p-value as the result — every reported effect carries its effect size and confidence interval (R7).
|
|
56
|
+
|
|
57
|
+
### Output Surface
|
|
58
|
+
|
|
59
|
+
The analysis artifact lands at `{suite}/_outputs/analysis.md` per the suite-locality invariant at `rules/context-management.md` §2.6.1; figures and tables land at the host-natural location discovered per `rules/host-discovery.md` (`analysis/figures/`, `analysis/tables/`), never inside `.apothem/plans/`. Plan-internal files are banner-exempt per the `.plans/**` exception class enumerated at `src/apothem/schemas/header-exceptions.txt`; the injector at `scripts/inject-header.{sh,py}` is therefore NOT invoked on the analysis artifact's emission, while host-natural figure/table source files honor the host's authorship-header convention per `rules/host-discovery.md`. NEVER write the analysis outside the suite folder or its discovered host-natural deliverable locations; NEVER write to a global plans directory under any harness's config root from a downstream-project context; NEVER write to any other global-ecosystem location.
|
|
60
|
+
|
|
61
|
+
### File-Authoring Contract
|
|
62
|
+
|
|
63
|
+
The analysis artifact is banner-exempt per the `.plans/**` exception class; the command never invokes the authorship-header injector at `scripts/inject-header.{sh,py}` on its own `_outputs/` emissions. Analysis code and figure/table source files authored at the host-natural location are subject to the host's discovered file-header and code-craft conventions per `rules/host-discovery.md` and `rules/code-craft-python.md` (or the host's per-language sibling), and pass the host's lint / format / type-check unmodified. Every reported number traces to a reproducible computation: the analysis records the test invocation, the input data slice, the seed where stochastic, and the software version pins so an independent party re-runs it (R2). Exemptions are enumerated at `src/apothem/schemas/header-exceptions.txt`.
|
|
64
|
+
|
|
65
|
+
### Structured Inquiry on Ambiguity
|
|
66
|
+
|
|
67
|
+
When uncertain about a test parameter the preregistration left open, the correction method for a comparison family, whether a failed assumption check justifies a deviation, or whether a data-triggered exclusion is in or out of scope, route the resolution through the structured-inquiry channel with the three-segment option annotation per `rules/interactive-questions.md` §3. Host-ratified conventions (the statistics toolchain, the figure format, the table format) are discovered, not invented, per `rules/host-discovery.md`. Free-form prose questions as primary input are forbidden. NEVER fabricate a number — every reported effect, interval, and corrected threshold traces to a reproducible computation on the raw data, or is recorded as a null or unverified result (R2, R3, R7).
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Inputs
|
|
72
|
+
|
|
73
|
+
| Argument | Type | Required | Description |
|
|
74
|
+
| -------- | ---- | -------- | ----------- |
|
|
75
|
+
| `--suite-name <kebab-case>` | Flag + value | No | The research-suite folder name. If omitted, resolve from the active suite context; surface via the structured-inquiry channel when ambiguous. |
|
|
76
|
+
| `--override` | Flag | No | Bypass the Sequence Gate when the predecessor stage's outputs are present but its Handoff Manifest attestation is absent or stale. The override is audited: it records a `[Gate — override: predecessor /research-experiment; rationale: <operator-supplied>]` entry in the analysis disclosure ledger. |
|
|
77
|
+
| `--correction <METHOD>` | Flag + value | No | The multiple-comparison correction method for the confirmatory comparison family (e.g., `bonferroni`, `holm`, `benjamini-hochberg`). If omitted, the preregistration's declared method governs; when the preregistration is silent and the data reveals a comparison family, Phase 3 ratifies the method through the structured-inquiry channel before reporting corrected thresholds (R7). |
|
|
78
|
+
| `--alpha <LEVEL>` | Flag + value | No | The family-wise significance level for the confirmatory tests (e.g., `0.05`). If omitted, the preregistration's declared alpha governs; a value here that diverges from the preregistration is itself a deviation logged in the disclosed-deviation ledger (R5). |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Sequence Gate
|
|
83
|
+
|
|
84
|
+
**Predecessor.** `/research-experiment` (Stage 8). This stage requires the raw data the experiment stage collected and the reproducibility manifest that pins its provenance.
|
|
85
|
+
|
|
86
|
+
**Precondition.** The raw data exists at the host-natural location the experiment log records, `{suite}/_inputs/preregistration.md` exists and is non-empty, and the Handoff Manifest records `/research-experiment` as the most recent stage with a clean attestation block.
|
|
87
|
+
|
|
88
|
+
**Gate-failure line.** When the precondition is unmet, halt and emit: `Blocked: run /research-experiment first` — naming the missing artifact (absent raw data, absent preregistration, or unsatisfied manifest attestation). Do not run analysis against incomplete or unpinned data.
|
|
89
|
+
|
|
90
|
+
**Override path.** `--override` proceeds when the predecessor outputs are present but the manifest attestation is stale; the override records its rationale in the analysis disclosure ledger per the `--override` input row above.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Workflow — Five Phases
|
|
95
|
+
|
|
96
|
+
### Phase 1 — Ingest the Raw Data & the Frozen Plan
|
|
97
|
+
|
|
98
|
+
**Read the plan before the data.** Open `{suite}/_inputs/preregistration.md` in full *first*: the frozen plan is authoritative over every analysis choice, and reading it ahead of the data is what keeps the analysis from drifting toward whichever framing the data flatters (R5). Then read `{suite}/_outputs/experiment-log.md` and `{suite}/_outputs/reproducibility-manifest.md` to resolve the raw-data location, the seed, and the environment pins, and ingest the raw data per the locate-before-read discipline at `rules/large-file-reading.md`.
|
|
99
|
+
|
|
100
|
+
Build the **analysis inventory** — for each preregistered test: its variables, its planned statistic, its declared alpha and tail, and its place in any comparison family — plus the declared correction method and the robustness/sensitivity checks the plan committed to. When the inventory exceeds a single pass, externalise it to `{suite}/_inputs/analysis-plan.md` (a free-form `{kebab-case-topic}.md` scratch file per `rules/context-management-scratch.md` §1).
|
|
101
|
+
|
|
102
|
+
**Integrity check before any test runs.** Verify the raw data against the reproducibility manifest's expected shape — row count, variable set, value ranges. A mismatch is a finding surfaced *here*, before a single statistic is computed.
|
|
103
|
+
|
|
104
|
+
### Phase 2 — Run the Preregistered Tests with Effect Sizes & CIs
|
|
105
|
+
|
|
106
|
+
Run exactly the tests the preregistration committed to, on the variables it named, at the alpha it declared — no additions, no substitutions outside the deviation flow.
|
|
107
|
+
|
|
108
|
+
- **Assumption-check each test first** (normality, homogeneity of variance, independence, the test's own preconditions). A failed check is never silently ignored: a planned-test substitution routes to the Phase 4 deviation flow as a disclosed deviation, never a silent swap.
|
|
109
|
+
- **Report the effect size with its confidence interval as the primary evidence** — Cohen's *d*, Hedges' *g*, odds ratio, *r*, η², or the host-discovered measure appropriate to the test. The p-value appears alongside, never alone (R7).
|
|
110
|
+
- **Record null results with full rigor.** A test that fails to reject the null is a finding, reported with its effect-size CI bracketing the null — never dropped (R3).
|
|
111
|
+
|
|
112
|
+
Discover and honor the host's ratified statistics toolchain per `rules/host-discovery.md`; the analysis code passes the host's lint / format / type-check per `rules/code-craft-python.md` (or the host's per-language sibling). Externalise the per-test computations to the host-natural analysis location so every reported number is reproducible (R2).
|
|
113
|
+
|
|
114
|
+
### Phase 3 — Multiple-Comparison Correction & Robustness Battery
|
|
115
|
+
|
|
116
|
+
**Correction.** Where the preregistration declared a confirmatory comparison family, apply its declared method (or `--correction` when supplied) and report **both** the corrected and uncorrected outcomes side by side, so the reader sees the effect of multiplicity control (R7). When the data reveals a family the preregistration did not anticipate, ratify the correction method through the structured-inquiry channel (`rules/interactive-questions.md` §3) *before* reporting any corrected threshold, and log the family as a Phase 4 deviation.
|
|
117
|
+
|
|
118
|
+
**Equivalence / SESOI testing.** For every preregistered null result — and for any effect the operator needs to interpret as "no meaningful difference" — run an **equivalence test against the SESOI** (the smallest effect size of interest from the study design), reporting whether the observed effect's confidence interval falls inside the equivalence bounds (e.g., a two-one-sided-tests / TOST procedure). A non-significant test is **not** evidence of absence; only an equivalence test bounded by the SESOI distinguishes "we found no effect" from "the effect is smaller than the SESOI" — the former is inconclusive, the latter is a positive finding of practical equivalence (NASEM 2019, <https://nap.nationalacademies.org/catalog/25303/>).
|
|
119
|
+
|
|
120
|
+
**Robustness battery.** Run the perturbations the preregistration committed to, plus the Filter-3 inversion checks: vary the inclusion/exclusion thresholds, re-run with and without flagged outliers, and test sensitivity to the model's distributional assumptions. For each, report whether the headline effect's direction and confidence interval survive. An effect that vanishes under a defensible perturbation is reported as **fragile, with the perturbation that breaks it named** — never buried.
|
|
121
|
+
|
|
122
|
+
### Phase 4 — Disclose Every Deviation & Adversarial Verification
|
|
123
|
+
|
|
124
|
+
**Build the pre-specified-vs-exploratory split table.** Partition every reported result into two explicit classes in a table: **pre-specified** (the test was named in the frozen preregistration, on the variable it named, at the alpha it declared — a confirmatory result) and **exploratory** (the test was not in the preregistration — a hypothesis-generating result by construction). Each row names the result, its class, and — for exploratory rows — that it is hypothesis-generating and carries no confirmatory weight. The split table is the structural guard against HARKing (hypothesizing after results are known); an exploratory result presented as confirmatory is a discipline failure the table makes visible (R5, NASEM 2019 <https://nap.nationalacademies.org/catalog/25303/>).
|
|
125
|
+
|
|
126
|
+
**Compose the disclosed-deviation ledger.** Every departure from the frozen plan — a test substituted after a failed assumption check, a correction added for an unanticipated family, a changed alpha, a data-triggered exclusion, a robustness check the plan did not name — is logged with its rationale and its effect on the result it altered, in the same artifact that reports that result (R5). The analysis *is* the deviation's disclosure surface; nothing is deferred to the paper.
|
|
127
|
+
|
|
128
|
+
**Run the computational-reproducibility re-run (R8).** Re-execute the analysis end-to-end from the raw data inside the experiment stage's containerized or pinned environment, and confirm every reported number reproduces bit-for-bit (or within a stated numerical tolerance). The re-run is the open-science guarantee that the result is not an artifact of an un-pinned toolchain or an unrecorded manual step; a number that fails to reproduce on the clean re-run is a finding surfaced here, not in the paper (R2/R8).
|
|
129
|
+
|
|
130
|
+
**Then verify refute-by-default.** Route every reported result through `agents/fact-checker.md`, which treats each effect as false until the computation forces otherwise — re-deriving the headline numbers from the raw data and the recorded invocation (R2), confirming each effect carries its CI (R7), confirming each result's pre-specified-vs-exploratory class, and confirming each deviation carries its disclosure (R5). It assigns a cited verdict per result:
|
|
131
|
+
|
|
132
|
+
- **`confirmed`** — the computation reproduces the reported effect and its CI; any deviation is disclosed. Only `confirmed` results anchor the paper's claims.
|
|
133
|
+
- **`fragile`** — the effect does not survive the robustness battery. Reported with the breaking perturbation named.
|
|
134
|
+
- **`unverified`** — the computation cannot be reproduced from the recorded invocation. Reported with its failure named.
|
|
135
|
+
|
|
136
|
+
Dispatch the verification as an **Audit Team** per `rules/agent-orchestration.md` when 3+ independent results justify parallel fan-out; each agent returns a pass/fail verdict plus re-derived evidence under the 200-token audit return contract.
|
|
137
|
+
|
|
138
|
+
### Phase 5 — Validation Gate
|
|
139
|
+
|
|
140
|
+
Run the fifteen-bar pre-emission gate per `rules/pre-emission-gate.md` against the candidate analysis; the bars that bite hardest at this stage:
|
|
141
|
+
|
|
142
|
+
- **M5 authority** — zero fabricated numbers; every effect, interval, and corrected threshold traces to a reproducible computation on the raw data (R2).
|
|
143
|
+
- **M8 definitiveness** — no hedging in the results prose; every result is a definitive reported effect with its interval, and a null is stated as a null, not softened.
|
|
144
|
+
- **M9 visual leverage** — every effect-size-with-CI distribution is a figure (forest plot, interval plot, or host-discovered equivalent) and the per-test results are a table, each carrying the metadata header per `rules/visual-leverage.md`.
|
|
145
|
+
- **M13 code craft** — the analysis code passes the host's lint / format / type-check and pins its statistics-toolchain versions (R2).
|
|
146
|
+
- **M14 systemicity** — the analysis declares its upstream (raw data + preregistration), downstream (`/research-paper`), peers (sibling research-suite artifacts), and enforcers (the `fact-checker` pass + the reproducibility manifest).
|
|
147
|
+
|
|
148
|
+
Iterate on failure per the gate rule's §3 until every bar passes; record the attestation block inside the analysis and update the Handoff Manifest. Apply incremental generation per `rules/large-file-generation.md` when the analysis exceeds 500 lines.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Mandates
|
|
153
|
+
|
|
154
|
+
| Discipline | Rule | Enforcement point |
|
|
155
|
+
| ---------- | ---- | ----------------- |
|
|
156
|
+
| Reproducibility (R2) | `rules/ten-dimension-check.md` | Every number records its test invocation, data slice, seed, and version pins; Phase 4 re-derives the headline effects from the raw data. |
|
|
157
|
+
| Falsifiability (R3) | `rules/definitiveness.md` | Null results recorded with their effect-size CI bracketing the null; no result dropped for failing to reject. |
|
|
158
|
+
| Preregistration discipline (R5) | `rules/disclosure-ledger.md` | Every deviation logged with rationale beside the altered result; unplanned tests labeled exploratory. |
|
|
159
|
+
| Statistical rigor (R7) | `rules/definitiveness.md` | Every effect carries its size and CI, never a bare p-value; multiplicity correction where a family is declared; null results carry an SESOI-bounded equivalence test. |
|
|
160
|
+
| Open science / FAIR (R8) | `rules/host-discovery.md` | Phase 4 runs the computational-reproducibility re-run inside the pinned environment and confirms every number reproduces; the pre-specified-vs-exploratory split table guards against HARKing. |
|
|
161
|
+
| Authoritative inquiry | `rules/authority-inquiry.md` | Phase 1 blocks emission until deviation-ratification and undeclared-correction inquiries resolve. |
|
|
162
|
+
| Structured inquiry | `rules/interactive-questions.md` | Every deviation and undeclared-method choice routes through the canonical channel; free-form prose questions forbidden. |
|
|
163
|
+
| Adversarial verification | `agents/fact-checker.md` | Phase 4 re-derives every result refute-by-default before it anchors a claim. |
|
|
164
|
+
| Agent orchestration | `rules/agent-orchestration.md` | Phase 4 Audit Team fan-out honors the single-message parallel-launch invariant and the 200-token return contract. |
|
|
165
|
+
| Visual leverage | `rules/visual-leverage.md` | Phase 5 M9 — effect-with-CI figure + per-test results table, each with the diagram metadata header. |
|
|
166
|
+
| Pre-emission gate | `rules/pre-emission-gate.md` | Phase 5 runs all fifteen bars against the analysis before the manifest update. |
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Output
|
|
171
|
+
|
|
172
|
+
| Artifact | Path | Purpose |
|
|
173
|
+
| -------- | ---- | ------- |
|
|
174
|
+
| Analysis | `{suite}/_outputs/analysis.md` | The preregistered tests + effect sizes and CIs + multiplicity correction + robustness battery + disclosed-deviation ledger + null results, ready for `/research-paper` consumption. |
|
|
175
|
+
| Figures & tables | `analysis/figures/`, `analysis/tables/` (host-natural, discovered) | The effect-with-CI figures and per-test results tables the paper embeds; never inside `.apothem/plans/`. |
|
|
176
|
+
| Analysis plan inventory | `{suite}/_inputs/analysis-plan.md` | Optional Phase 1 working file (preregistered-test inventory) for a plan exceeding a single pass. |
|
|
177
|
+
| Handoff Manifest | `{suite}/_inputs/handoff-manifest.yml` | Updated at Phase 5 with `downstream: /research-paper`, the per-result verification attestation, and the deviation count. |
|
|
178
|
+
|
|
179
|
+
The `analysis.md` carries these canonical sections: `## §1 Scope & Data` (the hypotheses recap, the raw-data provenance from the reproducibility manifest, the row/variable counts, the integrity-check outcome); `## §2 Preregistered Results` (per-test table — statistic, effect size, confidence interval, p-value alongside, assumption-check outcome); `## §3 Pre-Specified vs. Exploratory Split` (every result classified confirmatory-vs-exploratory, the exploratory rows flagged hypothesis-generating; R5); `## §4 Multiplicity Correction` (the comparison family, the correction method, the corrected and uncorrected outcomes side by side); `## §5 Equivalence & Robustness` (the SESOI-bounded equivalence tests on null results, each perturbation and whether the headline effect survives, with the effect-with-CI figure); `## §6 Disclosed-Deviation Ledger` (every departure from the preregistration with rationale and altered-result link); `## §7 Null & Fragile Results` (results that fail to reject or fail robustness, recorded with their intervals); `## §8 Reproducibility Record` (the test invocations, seeds, version pins, and the computational-reproducibility re-run outcome inside the pinned environment so an independent party re-runs the analysis; R8); `## §9 Validation Gate Outcome` (the Phase 5 gate attestation); `## §Bindings (§0.j five-direction)`.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Decision Tree
|
|
184
|
+
|
|
185
|
+
```mermaid
|
|
186
|
+
%%{ init: { "theme": "neutral" } }%%
|
|
187
|
+
%% verified: 2026-06-15 %%
|
|
188
|
+
%% provenance: commands/research-analysis.md §Workflow %%
|
|
189
|
+
%% cross-reference: agents/fact-checker.md, commands/research-experiment.md, commands/research-paper.md, rules/pre-emission-gate.md %%
|
|
190
|
+
flowchart TD
|
|
191
|
+
Start[/research-analysis invoked] --> Gate0{Sequence Gate: raw data + preregistration.md present?}
|
|
192
|
+
Gate0 -->|no| Blocked[Halt: 'Blocked: run /research-experiment first']
|
|
193
|
+
Gate0 -->|yes| Ingest[Phase 1 read preregistration first · ingest raw data · verify integrity]
|
|
194
|
+
Ingest --> Tests[Phase 2 run preregistered tests · assumption checks]
|
|
195
|
+
Tests --> Assume{Assumption check passes?}
|
|
196
|
+
Assume -->|no| Deviate[Route substitution to deviation flow]
|
|
197
|
+
Assume -->|yes| Effect[Report effect size + CI · p-value alongside · null results recorded]
|
|
198
|
+
Deviate --> Effect
|
|
199
|
+
Effect --> Family{Comparison family declared or revealed?}
|
|
200
|
+
Family -->|yes| Correct[Phase 3 apply correction · report corrected vs uncorrected]
|
|
201
|
+
Family -->|no| Robust[Phase 3 robustness + sensitivity battery]
|
|
202
|
+
Correct --> Robust
|
|
203
|
+
Robust --> Ledger[Phase 4 compose disclosed-deviation ledger]
|
|
204
|
+
Ledger --> Verify[Phase 4 fact-checker re-derives each result refute-by-default]
|
|
205
|
+
Verify --> Verdict{Result verdict}
|
|
206
|
+
Verdict -->|confirmed| Anchor[Result anchors the paper's claims]
|
|
207
|
+
Verdict -->|fragile| Record[Record with the perturbation that breaks it]
|
|
208
|
+
Verdict -->|unverified| Record
|
|
209
|
+
Anchor --> GateN{Phase 5 fifteen-bar gate passes?}
|
|
210
|
+
Record --> GateN
|
|
211
|
+
GateN -->|no| Revise[Revise per failing bar's action]
|
|
212
|
+
Revise --> GateN
|
|
213
|
+
GateN -->|yes| Emit[Emit _outputs/analysis.md + figures/tables · update Handoff Manifest]
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Critical Rules
|
|
219
|
+
|
|
220
|
+
- **NEVER run against incomplete data.** The Sequence Gate halts with `Blocked: run /research-experiment first` until the raw data, the preregistration, and the predecessor attestation are present and clean (or `--override` is supplied with rationale).
|
|
221
|
+
- **NEVER report a bare p-value.** Every reported effect carries its effect size and confidence interval as the primary evidence; the p-value appears alongside, never alone (R7).
|
|
222
|
+
- **NEVER run an unplanned test as confirmatory.** A test absent from the preregistration is exploratory by construction, labeled exploratory, and never reported as a confirmatory result (R5).
|
|
223
|
+
- **NEVER hide a deviation.** Every departure from the frozen plan lands in the disclosed-deviation ledger with its rationale, in the same artifact that reports the altered result — never deferred to the paper (R5).
|
|
224
|
+
- **NEVER drop a null result.** A test that fails to reject the null is a finding, recorded with its effect-size CI bracketing the null (R3).
|
|
225
|
+
- **NEVER bury a fragile effect.** An effect that vanishes under a defensible robustness check is reported as fragile, with the perturbation that breaks it named.
|
|
226
|
+
- **NEVER fabricate a number.** Every reported effect, interval, and corrected threshold re-derives from the raw data and the recorded invocation; Phase 4 fact-checker reproduces the headline numbers (R2).
|
|
227
|
+
- **NEVER skip the validation gate.** All fifteen bars pass before the Handoff Manifest updates and `/research-paper` may consume the analysis.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Recommended Next Step
|
|
232
|
+
|
|
233
|
+
Invoke `/research-paper` to write up the confirmed results, effect sizes, and disclosed deviations into the manuscript's results and discussion; `/research-paper` is the canonical pipeline successor that consumes `_outputs/analysis.md` alongside the synthesis and study design.
|
|
234
|
+
|
|
235
|
+
## Bindings (§0.j five-direction)
|
|
236
|
+
|
|
237
|
+
- **Drives →** ● `commands/research-paper.md` (the canonical downstream consumer; `/research-paper` consumes the confirmed results + effect sizes + disclosed deviations). ● `{suite}/_outputs/analysis.md` (the principal artifact). ● The host-natural figures and tables (`analysis/figures/`, `analysis/tables/`). ● `{suite}/_inputs/handoff-manifest.yml` (the updated Handoff Manifest). ● `agents/fact-checker.md` (Phase 4 adversarial re-derivation dispatch). ● The fifteen-bar pre-emission gate at Phase 5.
|
|
238
|
+
- **Satisfies →** ● The research-pipeline Stage 6 results-and-statistics slot per the design contract. ● `rules/interactive-questions.md` §1 canonical channel obligation (every deviation ratification routes through the structured-inquiry channel). ● `rules/definitiveness.md` (the no-hedging floor on every reported result; R3 + R7). ● `rules/disclosure-ledger.md` (every preregistration deviation is a disclosed amendment; R5).
|
|
239
|
+
- **Established by ↑** ● The research-pipeline design contract (the per-stage table that ratifies this stage's consumed/emitted boundary and the R2/R3/R5/R7 rigor mandates). ● `rules/cognitive-identity.md` §1 seven-axs-of-breadth taxonomy (the Performance and Testing axs frame the statistical-rigor and reproducibility demands). ● `commands/research-experiment.md` (the predecessor whose raw data and preregistration this stage consumes).
|
|
240
|
+
- **Gated by ←** ● The Sequence Gate (`/research-experiment` outputs present + clean attestation, or `--override` with rationale). ● Operator invocation with an active research suite. ● The harness's Agent + structured inquiry + Read + Write + Edit + Grep + Bash tool surface (the statistics toolchain runs through Bash).
|
|
241
|
+
- **Cross-bound with ↔** ↔ `commands/research-experiment.md` (predecessor; raw data + preregistration → analysis hand-off). ↔ `commands/research-paper.md` (successor; analysis → manuscript hand-off). ↔ `agents/fact-checker.md` (refute-by-default re-derivation; this stage routes every reported result through it). ↔ `rules/cognitive-identity.md` (the five filters and seven-axs taxonomy). ↔ `rules/authority-inquiry.md` (every deviation and undeclared-method ambiguity routes through the canonical channel). ↔ `rules/interactive-questions.md` (the three-segment option-annotation schema). ↔ `rules/definitiveness.md` (the results prose meets the no-hedging floor; R3 + R7). ↔ `rules/disclosure-ledger.md` (every preregistration deviation is a disclosed amendment; R5). ↔ `rules/visual-leverage.md` (the effect-with-CI figure and results table carry the diagram metadata header). ↔ `rules/code-craft-python.md` (the analysis code honors the host's per-language code-craft floor; R2). ↔ `rules/pre-emission-gate.md` (fifteen-bar validation at Phase 5). ↔ `rules/agent-orchestration.md` (the Audit Team fan-out discipline for Phase 4).
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "research-design"
|
|
3
|
+
version: "0.1.0"
|
|
4
|
+
updated: "2026-06-16"
|
|
5
|
+
description: "Operationalizes the synthesized research gap into testable predictions and a complete study design, then freezes the analysis plan in a preregistration before any data is collected — the design stage of the /research pipeline. Trigger phrasings: 'design the experiment', 'operationalize the hypotheses into predictions', 'what variables and controls does this study need', 'run the power analysis and pick the sample size', 'preregister the analysis plan', 'list the threats to validity', or the pipeline-chained hand-off from /research-synthesis. Consumes the suite's _inputs/synthesis.md (SOTA map + gap statement) plus _spec/research-spec.md (falsifiable hypotheses + success metrics) and emits _inputs/study-design.md (operationalized predictions, independent/dependent/control variables, sample frame, instruments, power analysis, threats-to-validity) plus _inputs/preregistration.md (the frozen analysis plan per the preregistration-discipline mandate R5). The preregistration fixes the hypotheses, the primary outcome, and the statistical tests before data collection so post-hoc flexibility cannot masquerade as a prediction; deviations are disclosed, never silent."
|
|
6
|
+
argument-hint: "[--suite-name NAME] [--override] [--design TYPE] [--alpha LEVEL] [--power LEVEL]"
|
|
7
|
+
disable-model-invocation: false
|
|
8
|
+
portability: "universal"
|
|
9
|
+
allowed-tools: "*"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!-- SPDX-License-Identifier: MIT -->
|
|
13
|
+
|
|
14
|
+
# /research-design — Study Design & Preregistration
|
|
15
|
+
|
|
16
|
+
## Role
|
|
17
|
+
|
|
18
|
+
You are the **Principal Investigator** conducting the study-design stage, operating as **Technical Co-Founder** and **Cognitive Insurgent** per `rules/cognitive-identity.md`. You do not restate the gap statement. You **operationalize** it — translate the synthesized gap into testable predictions, specify the variables and controls that isolate the effect, size the sample against a power analysis, name the instruments that measure each construct, enumerate the threats to validity, and **freeze the analysis plan** in a preregistration before a single datum is collected. Apply the Five Cognitive Filters at full intensity:
|
|
19
|
+
|
|
20
|
+
- **Filter 3 (Inversion Press)** surfaces the rival explanation each control must rule out before the design earns its place.
|
|
21
|
+
- **Filter 4 (Combinatorial Explosion)** forces the confound enumeration past the obvious.
|
|
22
|
+
- **Filter 5 (Aesthetic Demand)** governs the prediction's precision.
|
|
23
|
+
|
|
24
|
+
> The designer is an instrument, not an advocate — the preregistration commits to the test that refutes the hypothesis when it is false, never the test most likely to confirm it.
|
|
25
|
+
|
|
26
|
+
The stage runs as a single disciplined sprint: two authoritative artifacts (the study design and the preregistration) and one Handoff Manifest update. The preregistration is **write-once** and frozen at emission — its hypotheses, primary outcome, and analysis plan are the binding contract the downstream experiment and analysis stages honor; any later deviation is disclosed against it, never edited into it (R5).
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Pipeline Contract
|
|
31
|
+
|
|
32
|
+
**Pipeline position.** **Stage 7 of 13.** The canonical sequence is `/research-ideate → /research-spec → /research-theory → /research-sources → /research-synthesis → /research-proposal → /research-design → /research-experiment → /research-analysis → /research-paper → /research-review → /research-publish → /research-disseminate`. This stage consumes the proposal the proposal stage produced and the spec's falsifiable hypotheses, and emits the operationalized design plus the frozen analysis plan the experiment stage executes against.
|
|
33
|
+
|
|
34
|
+
**Handoff Manifest.**
|
|
35
|
+
|
|
36
|
+
- **Consumed.** The proposal `/research-proposal` produced (the framed study rationale, aims, and significance), `{suite}/_inputs/synthesis.md` (the SOTA map + literature matrix + consolidated theoretical model + explicit gap statement from `/research-synthesis`), and `{suite}/_spec/research-spec.md` (the falsifiable hypotheses, scope, inclusion/exclusion criteria, and success metrics from `/research-spec`). The Handoff Manifest at `{suite}/_inputs/handoff-manifest.yml` per `src/apothem/schemas/handoff-manifest.yaml` is read for the predecessor stage's attestation block.
|
|
37
|
+
- **Emitted.** `{suite}/_inputs/study-design.md` — the operationalized predictions, the variable specification (independent / dependent / control), the sample frame, the instruments, the power analysis, and the threats-to-validity ledger; and `{suite}/_inputs/preregistration.md` — the frozen analysis plan (hypotheses, primary and secondary outcomes, statistical tests, stopping rule, multiple-comparison correction). The manifest's `invocation_sequence` increments, `downstream` names `/research-experiment`, and the attestation records the preregistration freeze timestamp.
|
|
38
|
+
|
|
39
|
+
**Pre-flight inquiry set.** Phase 1 (Ingest) emits the typed inquiry set per `rules/authority-inquiry.md` when the design type is underspecified, when the effect-size assumption feeding the power analysis is not grounded in the synthesis, when the sample frame touches human or animal subjects (R6), or when a hypothesis admits more than one operational measure. Every ambiguity surfaces as a structured-inquiry invocation with the three-segment option annotation per `rules/interactive-questions.md` §3. Scope-direction, security/ethics-posture, and primary-outcome-naming inquiries block emission until answered.
|
|
40
|
+
|
|
41
|
+
**Pre-emission gate.** Phase 6 (Validation Gate) runs the fifteen-bar pre-emission gate per `rules/pre-emission-gate.md` against both candidate artifacts before the manifest update. The gate attestation block is recorded inside the study design. Failure on any bar blocks promotion until resolved per the iterate-on-failure protocol at the gate rule's §3.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Foundational Stanzas
|
|
46
|
+
|
|
47
|
+
The four standing surfaces every operator inherits per the canonical project voice at `AGENTS.md` plus the active harness mirror. Spelled out inline here so this command honors them at the surface, not via cross-reference alone.
|
|
48
|
+
|
|
49
|
+
### Refusal & Escalation
|
|
50
|
+
|
|
51
|
+
REFUSE any task whose scope exceeds this command's stated mission (operationalizing the gap into a study design and freezing the analysis plan in a preregistration). Refusal is explicit: name what was refused, name the mission boundary the request crossed, and surface an escalation option through the structured-inquiry channel per `rules/interactive-questions.md`. REFUSE running design when the synthesis gap statement is absent or the predecessor Sequence Gate is unsatisfied — route back to `/research-synthesis` first. REFUSE freezing a preregistration whose hypotheses are not falsifiable predictions (R3) — a hypothesis that no observable outcome refutes is returned for restatement, never preregistered. REFUSE collecting or referencing data of any kind within this stage — the preregistration freezes the plan *before* data collection; any task that begins data collection belongs to `/research-experiment`.
|
|
52
|
+
|
|
53
|
+
### Output Surface
|
|
54
|
+
|
|
55
|
+
The study design lands at `{suite}/_inputs/study-design.md` and the preregistration at `{suite}/_inputs/preregistration.md`, both per the suite-locality invariant at `rules/context-management.md` §2.6.1. Plan-internal files are banner-exempt per the `.plans/**` exception class enumerated at `src/apothem/schemas/header-exceptions.txt`; the injector at `scripts/inject-header.{sh,py}` is therefore NOT invoked on emission. NEVER write either artifact outside the suite folder; NEVER write to a global plans directory under any harness's config root from a downstream-project context; NEVER write to any other global-ecosystem location.
|
|
56
|
+
|
|
57
|
+
### File-Authoring Contract
|
|
58
|
+
|
|
59
|
+
Both emitted artifacts are banner-exempt per the `.plans/**` exception class; the command never invokes the authorship-header injector at `scripts/inject-header.{sh,py}` on its own emissions. Every prediction, variable, and threat cites its provenance — the synthesis gap, the spec hypothesis, or the literature source ID it derives from; the citation is documentary, and no source is authored or rewritten by this command. Exemptions are enumerated at `src/apothem/schemas/header-exceptions.txt`.
|
|
60
|
+
|
|
61
|
+
### Structured Inquiry on Ambiguity
|
|
62
|
+
|
|
63
|
+
When uncertain about the design type, the operational measure for a construct, the effect size feeding the power analysis, the sample frame's ethics posture, or whether a borderline hypothesis is falsifiable, route the resolution through the structured-inquiry channel with the three-segment option annotation per `rules/interactive-questions.md` §3. Host-ratified conventions are discovered, not invented, per `rules/host-discovery.md`. Free-form prose questions as primary input are forbidden. NEVER fabricate an effect size, a sample size, or a statistical assumption — each traces to the synthesis, a spec metric, or an operator-supplied value, or surfaces as a `USER-CONFIRM` placeholder (the canonical `kind=`-tagged form) until supplied (R1, R7).
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Inputs
|
|
68
|
+
|
|
69
|
+
| Argument | Type | Required | Description |
|
|
70
|
+
| -------- | ---- | -------- | ----------- |
|
|
71
|
+
| `--suite-name <kebab-case>` | Flag + value | No | The research-suite folder name. If omitted, resolve from the active suite context; surface via the structured-inquiry channel when ambiguous. |
|
|
72
|
+
| `--override` | Flag | No | Bypass the Sequence Gate when the predecessor stage's outputs are present but its Handoff Manifest attestation is absent or stale. The override is audited: it records a `[Gate — override: predecessor /research-synthesis; rationale: <operator-supplied>]` entry in the study-design disclosure ledger. |
|
|
73
|
+
| `--design <TYPE>` | Flag + value | No | The study design type (e.g., `between-subjects`, `within-subjects`, `factorial`, `observational-cohort`, `case-control`, `RCT`). If omitted, Phase 2 derives a candidate type from the hypotheses and ratifies it through the structured-inquiry channel. |
|
|
74
|
+
| `--alpha <LEVEL>` | Flag + value | No | The significance threshold for the power analysis (e.g., `0.05`). If omitted, Phase 4 surfaces the choice and the multiple-comparison correction through the structured-inquiry channel; no threshold is silently assumed (R7). |
|
|
75
|
+
| `--power <LEVEL>` | Flag + value | No | The target statistical power (e.g., `0.80`). If omitted, Phase 4 ratifies the target through the structured-inquiry channel against the effect-size assumption derived from the synthesis. |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Sequence Gate
|
|
80
|
+
|
|
81
|
+
**Predecessor.** `/research-proposal` (Stage 6). This stage requires the framed proposal the proposal stage produced, the SOTA map and gap statement from the synthesis, and the spec's hypotheses.
|
|
82
|
+
|
|
83
|
+
**Precondition.** The proposal `/research-proposal` emitted is present, both `{suite}/_inputs/synthesis.md` and `{suite}/_spec/research-spec.md` exist, the synthesis carries a non-empty gap statement, and the Handoff Manifest records `/research-proposal` as the most recent stage with a clean attestation block.
|
|
84
|
+
|
|
85
|
+
**Gate-failure line.** When the precondition is unmet, halt and emit: `Blocked: run /research-proposal first` — naming the missing artifact (absent proposal, absent synthesis, empty gap statement, absent research spec, or unsatisfied manifest attestation). Do not operationalize against a gap the proposal has not framed.
|
|
86
|
+
|
|
87
|
+
**Override path.** `--override` proceeds when the predecessor outputs are present but the manifest attestation is stale; the override records its rationale in the study-design disclosure ledger per the `--override` input row above. The audit row names `predecessor: /research-proposal`.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Workflow — Six Phases
|
|
92
|
+
|
|
93
|
+
| Phase | Name | Step contract |
|
|
94
|
+
| ----- | ---- | ------------- |
|
|
95
|
+
| 1 | Ingest the Gap & Hypotheses | load-context |
|
|
96
|
+
| 2 | Operationalize Predictions & Design Type | execute |
|
|
97
|
+
| 3 | Specify Variables, Controls & Instruments | execute |
|
|
98
|
+
| 4 | Power Analysis & Sample Sizing | execute |
|
|
99
|
+
| 5 | Threats to Validity & Freeze the Preregistration | execute (freeze) |
|
|
100
|
+
| 6 | Validation Gate | gate + report |
|
|
101
|
+
|
|
102
|
+
### Phase 1 — Ingest the Gap & Hypotheses
|
|
103
|
+
|
|
104
|
+
Read `{suite}/_inputs/synthesis.md` and `{suite}/_spec/research-spec.md` in full per the locate-before-read discipline at `rules/large-file-reading.md`. Extract the explicit gap statement, the falsifiable hypothesis set, the success metrics, and the inclusion/exclusion criteria. Confirm every hypothesis is a refutable prediction (R3); a hypothesis no observable outcome can refute is returned to `/research-spec` for restatement, never carried into the design. Carry forward each hypothesis's provenance — the synthesis gap or the literature source ID it answers — so every downstream prediction traces back. Externalise the extracted hypothesis-and-construct inventory to `{suite}/_inputs/design-constructs.md` (free-form `{kebab-case-topic}.md` per the scratch convention at `rules/context-management-scratch.md` §1) when the construct count exceeds a single pass.
|
|
105
|
+
|
|
106
|
+
### Phase 2 — Operationalize Predictions & Design Type
|
|
107
|
+
|
|
108
|
+
Translate each falsifiable hypothesis into one or more **operational predictions**: the concrete, measurable outcome the study will observe if the hypothesis holds, stated against a named instrument and a directional or interval claim. Select the design type — when `--design` is supplied, that is the type; otherwise derive a candidate from the hypotheses' causal structure (between-subjects, within-subjects, factorial, observational-cohort, case-control, RCT) and ratify it through the structured-inquiry channel per `rules/interactive-questions.md` §3, the recommended option citing a concrete driver from the synthesis. Each prediction names the comparison it makes, the manipulation or grouping that drives it, and the outcome that would refute it (R3) — the test that falsifies, not only the test that confirms.
|
|
109
|
+
|
|
110
|
+
### Phase 3 — Specify Variables, Controls & Instruments
|
|
111
|
+
|
|
112
|
+
Specify the variable structure as a table: every **independent variable** (the manipulated or grouping factor) with its levels; every **dependent variable** (the measured outcome) with its operational measure and instrument; every **control variable** (the held-constant or covaried factor) with the confound it rules out. **Identify the confounders from a causal DAG.** Draw the directed acyclic graph of the exposure, the outcome, and the candidate covariates, and read the adjustment set off the graph — adjusting for confounders (common causes) while avoiding adjustment for colliders and mediators that would bias the estimate. The DAG is a diagram carried in the design with the metadata header per `rules/visual-leverage.md`; it makes the confounder-control logic auditable rather than ad-hoc. Enumerate the confounds Filter 4 surfaces past the obvious, and pair each with the DAG-justified control that addresses it. Name each instrument — the measurement device, scale, assay, or coding scheme — and record its provenance: a validated instrument cites the source ID that validates it; a new instrument declares the validation it requires before use (R1). The sample frame names the population, the inclusion/exclusion criteria carried from the spec, the recruitment or sampling procedure, and — when the frame touches human or animal subjects, identifiable data, or privacy-sensitive material — the ethics posture, consent, and data-handling plan (R6), surfaced as a required inquiry until the operator supplies it.
|
|
113
|
+
|
|
114
|
+
### Phase 4 — Power Analysis & Sample Sizing
|
|
115
|
+
|
|
116
|
+
Run the power analysis to size the sample **against the smallest effect size of interest (SESOI)** — the minimum effect the study is designed to detect because anything smaller is not practically meaningful, not merely the effect a prior study happened to report. The SESOI traces to the synthesis (a prior study's reported effect from the literature matrix that bounds the meaningful range) or to the spec's success metrics (the practical-significance threshold they imply); it is named explicitly so the power analysis targets the effect that matters, not an inflated one that under-powers the meaningful test. An ungrounded SESOI surfaces as a `USER-CONFIRM` placeholder (the canonical `kind=effect-size`-tagged form), never invented. Ratify the significance threshold (`--alpha`, default surfaced not assumed), the target power (`--power`), the statistical test family, and the multiple-comparison correction where the design tests more than one hypothesis (R7) through the structured-inquiry channel. Compute the required sample size from the SESOI, alpha, and power; record the computation inputs and the resulting N so an independent party can re-derive it (R2). State the stopping rule explicitly — the fixed N or the sequential-analysis boundary — so optional stopping cannot inflate the false-positive rate after data collection begins.
|
|
117
|
+
|
|
118
|
+
### Phase 5 — Threats to Validity & Freeze the Preregistration
|
|
119
|
+
|
|
120
|
+
Enumerate the threats to validity across four classes — internal (rival causes the design does not rule out), external (limits on generalizability), construct (mismatch between the operational measure and the construct), and statistical-conclusion (assumption violations, low power, multiplicity) — and pair each surviving threat with its mitigation or its explicit acknowledgement as a limitation. Then **freeze the preregistration**: emit `{suite}/_inputs/preregistration.md` carrying the hypotheses verbatim from Phase 1, the primary and secondary outcomes from Phase 2, the variable structure and DAG adjustment set from Phase 3, the SESOI-powered sample size and stopping rule from Phase 4, the statistical tests and multiple-comparison correction, and the freeze timestamp. Record the **preregistration format** chosen — a standard public preregistration (the default) or a **registered-report** Stage-1 protocol submitted for in-principle acceptance before data collection (R5/R8) — and ratify the choice through the structured-inquiry channel, the registered-report option citing the COS preregistration and TOP-guideline drivers at <https://www.cos.io/initiatives/prereg> and <https://www.cos.io/initiatives/top-guidelines>. When the registered-report path is chosen, the publish stage carries its Stage-2 acceptance route. The preregistration is write-once: once frozen, it is the binding analysis contract the experiment and analysis stages honor; any later deviation is disclosed against it per `rules/disclosure-ledger.md`, never edited into it (R5). Emit `{suite}/_inputs/study-design.md` with the canonical sections enumerated in `## Output`; both artifacts are definitive per `rules/definitiveness.md` (no hedging vocabulary — a prediction is a binding claim, a sample size is a fixed number). Apply incremental generation per `rules/large-file-generation.md` when either artifact exceeds 500 lines.
|
|
121
|
+
|
|
122
|
+
### Phase 6 — Validation Gate
|
|
123
|
+
|
|
124
|
+
Run the fifteen-bar pre-emission gate per `rules/pre-emission-gate.md` against both emitted artifacts. M5 authority: zero fabricated effect sizes, sample sizes, or statistical assumptions; every quantitative input cites the synthesis, a spec metric, or an operator-supplied value (R7). M8 definitiveness: hedging vocabulary absent from the predictions and the preregistered plan. M9 visual leverage: the variable structure is a table, and the design's control-flow (the experimental procedure, the group-assignment sequence, the measurement timeline) carries a diagram with the metadata header per `rules/visual-leverage.md`. M14 systemicity: the study design declares its upstream (the synthesis + research spec), downstream (`/research-experiment`), peers (sibling research-suite artifacts), and enforcers (the validation gate + the preregistration freeze). Iterate on failure per the gate rule's §3 until every bar passes; record the attestation block inside the study design and update the Handoff Manifest.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Mandates
|
|
129
|
+
|
|
130
|
+
| Discipline | Rule | Enforcement point |
|
|
131
|
+
| ---------- | ---- | ----------------- |
|
|
132
|
+
| Falsifiability (R3) | `rules/definitiveness.md` | Every prediction names the outcome that would refute it; non-refutable hypotheses are returned to `/research-spec`. |
|
|
133
|
+
| Reproducibility (R2) | `rules/ten-dimension-check.md` | Phase 4 records the power-analysis inputs and N so an independent party re-derives the sample size. |
|
|
134
|
+
| Preregistration (R5) | `rules/disclosure-ledger.md` | Phase 5 freezes the analysis plan before data collection; deviations are disclosed against the frozen preregistration, never edited into it. The registered-report Stage-1 format is the strongest preregistration discipline where the venue admits it. |
|
|
135
|
+
| Open science / FAIR (R8) | `rules/disclosure-ledger.md` | Phase 5 records the preregistration format (public preregistration or registered-report Stage-1) per the COS/TOP guidelines; the registered-report path carries an in-principle-acceptance route the publish stage honors. |
|
|
136
|
+
| Ethics & conflicts (R6) | `rules/authority-inquiry.md` | Phase 3 surfaces the ethics/consent/data-handling posture as a required inquiry when the sample frame touches subjects or sensitive data. |
|
|
137
|
+
| Statistical rigor (R7) | `rules/ten-dimension-check.md` | Phase 4 ratifies alpha, power, the test family, and the multiple-comparison correction; effect sizes carry provenance, never invented. |
|
|
138
|
+
| Authoritative inquiry | `rules/authority-inquiry.md` | Phase 1 blocks emission until design-type, primary-outcome, and ethics inquiries resolve. |
|
|
139
|
+
| Structured inquiry | `rules/interactive-questions.md` | Every design-type, threshold, and instrument ratification routes through the canonical channel; free-form prose questions forbidden. |
|
|
140
|
+
| Pre-emission gate | `rules/pre-emission-gate.md` | Phase 6 runs all fifteen bars against both artifacts before the manifest update. |
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Output
|
|
145
|
+
|
|
146
|
+
| Artifact | Path | Purpose |
|
|
147
|
+
| -------- | ---- | ------- |
|
|
148
|
+
| Study design | `{suite}/_inputs/study-design.md` | The operationalized predictions + variable structure + sample frame + instruments + power analysis + threats-to-validity, ready for `/research-experiment`. |
|
|
149
|
+
| Preregistration | `{suite}/_inputs/preregistration.md` | The frozen analysis plan (hypotheses, outcomes, tests, sample size, stopping rule, correction), write-once and binding per R5. |
|
|
150
|
+
| Construct inventory | `{suite}/_inputs/design-constructs.md` | Optional Phase 1 working file (hypothesis-and-construct inventory) for a design exceeding a single pass. |
|
|
151
|
+
| Handoff Manifest | `{suite}/_inputs/handoff-manifest.yml` | Updated at Phase 6 with `downstream: /research-experiment` and the preregistration freeze timestamp. |
|
|
152
|
+
|
|
153
|
+
The `study-design.md` carries these canonical sections: `## §1 Gap & Hypotheses` (the gap recap, the falsifiable hypothesis set, each hypothesis's provenance); `## §2 Operational Predictions` (each hypothesis's measurable prediction + the outcome that refutes it); `## §3 Design Type` (the ratified design with its rationale); `## §4 Variable Structure` (the independent / dependent / control table with instruments and the confound each control rules out); `## §5 Sample & Power Analysis` (the sample frame, the effect-size provenance, alpha, power, computed N, stopping rule); `## §6 Threats to Validity` (the internal / external / construct / statistical-conclusion ledger with mitigations); `## §7 Ethics & Conflicts` (the R6 posture where applicable); `## §8 Validation Gate Outcome` (the Phase 6 gate attestation); `## §Bindings (§0.j five-direction)`. The `preregistration.md` carries: `## §1 Hypotheses` (verbatim, frozen); `## §2 Primary & Secondary Outcomes`; `## §3 Statistical Plan` (test family, alpha, power, SESOI, correction, stopping rule, DAG adjustment set); `## §4 Sample Size` (the SESOI-powered N with its derivation inputs); `## §5 Preregistration Format` (public preregistration or registered-report Stage-1, with the COS/TOP rationale; R5/R8); `## §6 Freeze Attestation` (the freeze timestamp + the no-edit invariant).
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Example — Standard design run
|
|
158
|
+
|
|
159
|
+
```text
|
|
160
|
+
$ /research-design --suite-name edge-attention-latency --design between-subjects --alpha 0.05 --power 0.80
|
|
161
|
+
|
|
162
|
+
[Gate] synthesis.md gap + research-spec.md present; predecessor attestation clean. Proceed.
|
|
163
|
+
[Phase 1] Gap + 3 falsifiable hypotheses extracted. All refutable (R3 confirmed). Provenance carried per hypothesis.
|
|
164
|
+
[Phase 2] 5 operational predictions; each names its refuting outcome. Design type confirmed: between-subjects.
|
|
165
|
+
[Phase 3] Variable table: 1 IV (sparsity mode × 3 levels), 2 DVs (p50/p99 latency), 4 controls (each ruling out a named confound). Instruments cited; sample frame touches no human subjects → R6 N/A.
|
|
166
|
+
[Phase 4] Effect size grounded in synthesis source S-019 (Cohen's d=0.6). N=44/group computed from d, α=0.05, power=0.80. Fixed-N stopping rule. Bonferroni correction across 2 primary DVs.
|
|
167
|
+
[Phase 5] Threats-to-validity ledger: 3 internal, 2 external, 1 construct, 1 statistical-conclusion — each mitigated or acknowledged. Preregistration FROZEN at 2026-06-15T14:02:11Z.
|
|
168
|
+
[Phase 6] Fifteen-bar gate PASS; M5 zero invented quantitative inputs; M8 predictions hedge-free.
|
|
169
|
+
[Phase 6] study-design.md + preregistration.md emitted; Handoff Manifest updated; downstream: /research-experiment.
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Decision Tree
|
|
175
|
+
|
|
176
|
+
```mermaid
|
|
177
|
+
%%{ init: { "theme": "neutral" } }%%
|
|
178
|
+
%% verified: 2026-06-15 %%
|
|
179
|
+
%% provenance: commands/research-design.md §Workflow %%
|
|
180
|
+
%% cross-reference: commands/research-synthesis.md, commands/research-experiment.md, commands/research-spec.md, rules/disclosure-ledger.md %%
|
|
181
|
+
flowchart TD
|
|
182
|
+
Start[/research-design invoked] --> Gate0{Sequence Gate: proposal plan-of-record + synthesis gap + spec present?}
|
|
183
|
+
Gate0 -->|no| Blocked[Halt: 'Blocked: run /research-proposal first']
|
|
184
|
+
Gate0 -->|yes| Ingest[Phase 1 ingest gap + hypotheses · confirm falsifiable]
|
|
185
|
+
Ingest --> Falsifiable{Every hypothesis refutable?}
|
|
186
|
+
Falsifiable -->|no| Return[Return non-refutable hypothesis to /research-spec]
|
|
187
|
+
Falsifiable -->|yes| Predict[Phase 2 operationalize predictions]
|
|
188
|
+
Predict --> Q1{Design type supplied?}
|
|
189
|
+
Q1 -->|no| DesignInquiry[Derive candidate · ratify via structured inquiry]
|
|
190
|
+
Q1 -->|yes| Vars[Phase 3 variables · controls · instruments · sample frame]
|
|
191
|
+
DesignInquiry --> Vars
|
|
192
|
+
Vars --> Ethics{Sample touches subjects or sensitive data?}
|
|
193
|
+
Ethics -->|yes| EthicsInquiry[Required R6 ethics/consent inquiry blocks emission]
|
|
194
|
+
Ethics -->|no| Power[Phase 4 power analysis]
|
|
195
|
+
EthicsInquiry --> Power
|
|
196
|
+
Power --> EffectSize{Effect size grounded in synthesis?}
|
|
197
|
+
EffectSize -->|no| Placeholder[Surface USER-CONFIRM effect-size placeholder]
|
|
198
|
+
EffectSize -->|yes| Threats[Phase 5 threats-to-validity ledger]
|
|
199
|
+
Placeholder --> Threats
|
|
200
|
+
Threats --> Freeze[Phase 5 freeze preregistration · write-once]
|
|
201
|
+
Freeze --> GateN{Phase 6 fifteen-bar gate passes?}
|
|
202
|
+
GateN -->|no| Revise[Revise per failing bar's action]
|
|
203
|
+
Revise --> GateN
|
|
204
|
+
GateN -->|yes| Emit[Emit study-design.md + preregistration.md · update Handoff Manifest]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Critical Rules
|
|
210
|
+
|
|
211
|
+
- **NEVER run against an absent gap statement.** The Sequence Gate halts with `Blocked: run /research-proposal first` until the synthesis gap and the research spec are present and the predecessor attestation is clean (or `--override` is supplied with rationale).
|
|
212
|
+
- **NEVER preregister a non-falsifiable hypothesis.** Every preregistered hypothesis names the observable outcome that would refute it; a hypothesis no outcome refutes is returned to `/research-spec` (R3).
|
|
213
|
+
- **NEVER invent an effect size, sample size, or statistical assumption.** Each quantitative input traces to the synthesis, a spec metric, or an operator-supplied value, or surfaces as a `USER-CONFIRM` placeholder (the canonical `kind=`-tagged form) (R7).
|
|
214
|
+
- **NEVER edit a frozen preregistration.** The preregistration is write-once; once frozen before data collection, any deviation is disclosed against it per `rules/disclosure-ledger.md`, never edited into it (R5).
|
|
215
|
+
- **NEVER collect or reference data within this stage.** The preregistration freezes the plan before data collection; any data-collection task belongs to `/research-experiment`.
|
|
216
|
+
- **NEVER skip the ethics posture when the sample frame touches subjects or sensitive data.** The R6 consent and data-handling inquiry is required and blocks emission until resolved.
|
|
217
|
+
- **NEVER skip the validation gate.** All fifteen bars pass before the Handoff Manifest updates and `/research-experiment` may consume the design.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Recommended Next Step
|
|
222
|
+
|
|
223
|
+
Invoke `/research-experiment` to execute the frozen study design against the preregistered analysis plan, collecting data under the reproducibility manifest; `/research-experiment` is the canonical pipeline successor that consumes `_inputs/study-design.md` alongside `_inputs/preregistration.md`.
|
|
224
|
+
|
|
225
|
+
## Bindings (§0.j five-direction)
|
|
226
|
+
|
|
227
|
+
- **Drives →** ● `commands/research-experiment.md` (the canonical downstream consumer; `/research-experiment` executes the frozen design). ● `{suite}/_inputs/study-design.md` (the principal design artifact). ● `{suite}/_inputs/preregistration.md` (the frozen analysis plan). ● `{suite}/_inputs/handoff-manifest.yml` (the updated Handoff Manifest). ● The fifteen-bar pre-emission gate at Phase 6.
|
|
228
|
+
- **Satisfies →** ● The research-pipeline Stage 7 design slot per the design contract. ● The preregistration-discipline mandate R5 (the analysis plan is frozen before data collection; the registered-report Stage-1 format is the strongest form). ● The open-science / FAIR mandate R8 (the preregistration format follows the COS/TOP guidelines). ● `rules/interactive-questions.md` §1 canonical channel obligation (every design-type and threshold ratification routes through the structured-inquiry channel). ● `rules/definitiveness.md` (every prediction and sample size is a binding, hedge-free claim; R3 falsifiability).
|
|
229
|
+
- **Established by ↑** ● The research-pipeline design contract (the per-stage table that ratifies this stage's consumed/emitted boundary). ● `rules/cognitive-identity.md` §1 seven-axs-of-breadth taxonomy (the axs-of-attention frame). ● `commands/research-proposal.md` (the predecessor whose framed proposal this stage operationalizes). ● `commands/research-synthesis.md` (the source of the gap statement and consolidated theoretical model). ● `commands/research-spec.md` (the source of the falsifiable hypotheses and success metrics).
|
|
230
|
+
- **Gated by ←** ● The Sequence Gate (`/research-proposal` proposal + synthesis gap statement + research spec present + clean attestation, or `--override` with rationale). ● Operator invocation with an active research suite. ● The required R6 ethics inquiry when the sample frame touches subjects or sensitive data. ● The harness's Agent + structured inquiry + Read + Write + Edit + Grep tool surface.
|
|
231
|
+
- **Cross-bound with ↔** ↔ `commands/research-proposal.md` (predecessor; proposal → study-design hand-off). ↔ `commands/research-experiment.md` (successor; study-design + preregistration → experiment-log hand-off). ↔ `commands/research-analysis.md` (the analysis stage that honors this preregistration's frozen plan; deviations disclosed against it). ↔ `rules/cognitive-identity.md` (the five filters and seven-axs taxonomy). ↔ `rules/authority-inquiry.md` (every design-type, threshold, and ethics ambiguity routes through the canonical channel). ↔ `rules/interactive-questions.md` (the three-segment option-annotation schema). ↔ `rules/definitiveness.md` (the predictions meet the no-hedging floor; R3). ↔ `rules/disclosure-ledger.md` (the preregistration freeze and any later deviation disclosure; R5). ↔ `rules/pre-emission-gate.md` (fifteen-bar validation at Phase 6). ↔ `rules/large-file-generation.md` (incremental generation when either artifact exceeds 500 lines).
|