name: company-repo-checker kind: function version: 0.15.0
Company Repo Checker
Ensures a company-as-prose repository is still organized as an OpenProse-native package before runtime tests or fleet monitors do more expensive work.
This is a reusable public contract. It describes what a company-native repo
should preserve; the agent host executing prose run supplies the concrete
read/search operations.
Parameters
repo_path: local path to the company-as-prose OpenProse rootsource_roots: optional list of source roots relative to<openprose-root>; default["src"]ignored_roots: optional list of roots ignored by the default check; default["dist","runs","state","deps","customers"]external_prefixes: optional service-reference prefixes that are resolved outside this package; default["std/","co/","github.com/","gitlab.com/"]
Returns
report: structured readiness report containing:source_layout: authored intent under declared source rootscontract_surface: contracts declare their call/subscription interfacetest_pairing: every contract has a paired test subjecttest_metadata: tests declare subject, tier, contract_version, Expects, Expects Not, and Performance Tracked Over Timedependency_graph: contract references resolve and do not cross package-private boundariescounts: contract count, test count, dependency edge count
passed: boolean true only when all hard failures are emptyfailures: array of specific file-grounded failures, empty when passed; the returnedreportcarriespassed: trueexactly when every failure array is empty
Invariants
- inspect the repo as a bounded package walk rooted at
repo_path - ignore
<openprose-root>/dist/,<openprose-root>/runs/,<openprose-root>/state/,<openprose-root>/deps/, and nested customer packages unless explicitly asked - fail when executable metadata does not match current OpenProse kind and tier values
- fail authored Prose source with
kind:frontmatter that is not stored as*.prose.md - treat cross-package private dependencies as source ownership bugs; promote the shared primitive or keep the helper local
- produce file-grounded failures that a maintainer can act on directly
- avoid quality scoring here; runtime fleet checks own probabilistic and semantic judgments
Errors
parse_failed: a Contract Markdown file cannot be read or parsedunresolved_service: a referenced contract does not resolve in the package walktest_drift: a contract lacks a paired test or a test subject does not resolvesource_layout_violation: authored Prose source appears outside declared source rootsownership_violation: shared code depends on package-private code, or one package depends directly on another package's private source
Execution
parallel:
let source_layout = call repo-structure-inspector
repo_path: repo_path
source_roots: source_roots
ignored_roots: ignored_roots
let contract_surface = call contract-test-drift-inspector
repo_path: repo_path
source_roots: source_roots
ignored_roots: ignored_roots
let dependency_graph = call dependency-graph-inspector
repo_path: repo_path
source_roots: source_roots
ignored_roots: ignored_roots
external_prefixes: external_prefixes
let report = call repo-readiness-reporter
source_layout: source_layout
contract_surface: contract_surface
dependency_graph: dependency_graph
return report
repo-structure-inspector
Parameters
repo_path: local path to inspectsource_roots: source roots to treat as package-owned authored intentignored_roots: roots to skip in default scope
Returns
source_layout: report with:source_roots: status for each declared source rootsource_extensions: file-grounded findings for authored Prose source that does not use*.prose.md
failures: array of source layout violations
Invariants
- use the package root as the boundary
- treat README.md and other plain documentation as documentation, not authored
Prose source, unless they contain
kind:frontmatter - flag authored Prose source outside declared source roots
contract-test-drift-inspector
Parameters
repo_path: local path to inspectsource_roots: source roots to treat as package-owned sourceignored_roots: roots to skip in default scope
Returns
contract_surface: report with:contracts: every top-level contract found under source roots, keyed by itskind(responsibility,function,gateway,pattern)missing_contract_sections: data-flow contracts missing### Requiresor### Maintains, and callables missing### Parametersor### Returnstest_pairing: paired test subject status for each contracttest_metadata: subject, tier, contract_version, Expects, Expects Not, and Performance Tracked Over Time status for each testcounts: contract count per kind, and test count
failures: array of contract or test drift violations
Invariants
- parse Contract Markdown according to the OpenProse spec: frontmatter for
identity,
###sections for contracts,#headings as human titles - treat a
kind: functionplus### Requires/### Maintainsas a kind mismatch; a callable declares### Parameters/### Returns, while a standing subscribable truth is aresponsibility - require responsibility tests to use
tier: responsibilityand function tests to usetier: function, not retired tiers from older OpenProse releases - require test subjects to resolve to a contract in the same package or a shared source root
- allow patterns to be tested only through a contract that instantiates them
dependency-graph-inspector
Parameters
repo_path: local path to inspectsource_roots: source roots to treat as package-owned sourceignored_roots: roots to skip in default scopeexternal_prefixes: service-reference prefixes resolved outside this package
Returns
dependency_graph: report with:source_names: globally unique contract names under source rootsedges: resolved dependency edges (intra-nodecalltargets and cross-node subscriptions)unresolved: contract references that do not resolve by source name or explicit external pathownership_violations: shared-to-package-private or package-to-package-private dependenciescounts: dependency edge count
failures: array of dependency graph violations
Invariants
- resolve plain contract names by
name:across the bounded package walk - treat
std/...,co/..., host-qualified dependency paths, explicit relative paths, and explicit.prose.mdpaths as external references rather than unresolved local names - fail when a shared contract depends on a package-private contract
- fail when one package depends directly on another package's private source
- if a cross-package dependency is intentional, require promotion into shared or an explicit path plus TODO naming the promotion condition
repo-readiness-reporter
Parameters
source_layout: output from repo-structure-inspectorcontract_surface: output from contract-test-drift-inspectordependency_graph: output from dependency-graph-inspector
Returns
report: merged readiness report with sections for source_layout, contract_surface, test_pairing, test_metadata, dependency_graph, and countspassed: boolean true only when all failure arrays are emptyfailures: concatenated file-grounded failures from all inspectors
Invariants
- keep the summary short enough for CI or PR review
- list failures before counts
- preserve exact file paths and contract names from inspector outputs
- do not downgrade hard failures to warnings