← Files Computable Systems EngineeringARCHIVED FILE
docs/function-flow-review.md
7.74 KB · Dec 3, 2026 · 18:30 UTC
# Explicit function and flow review
Use this check when an engineer has authored finite step semantics and wants to
review function inputs, transformation descriptions, outputs, enabling conditions,
performers, accountable owners and decomposition boundaries together. This is an
optional bounded contract. It does not convert a concept narrative, native SysML
action or function-tree diagram into executable behavior.
Run the dependency-free checker through the analysis dispatcher:
```text
python3 scripts/analyze.py functional-graph examples/function-flow/library-return.json
```
The [library return](../examples/function-flow/library-return.json),
[water treatment](../examples/function-flow/water-treatment.json) and
[order fulfillment](../examples/function-flow/order-fulfillment.json) fixtures are
synthetic proposed models. They use the same checker with Boolean or bounded
integer quantities. They are checker demonstrations, not validated operating
procedures or capacity studies. No new visuals are generated by this check.
## Contract: function-flow-1.0
The JSON record contains the existing explicitly authored [finite model](verifier-v2.md)
as `finite_model`, with its canonical `verifier.core.digest` in
`finite_model_sha256`. A changed model requires an explicit revised binding; the
checker refuses stale bindings before execution. This digest identifies bytes
under the existing canonical serialization, not engineer acceptance or protection
against a same-user writer. Function IDs are explicit profile identities; scenario,
step, actor, property and data references bind to the supplied finite model. Native
SysML identity extraction and execution are unsupported by this bare adapter.
Use the optional [native correspondence check](function-native-binding.md) to pin
native source bytes and validate explicit identity/type mappings before this
finite check. It adds no native behavior execution.
| Field | Explicit meaning |
|---|---|
| `functions` | ID map of `{label, transformation, inputs, outputs, enabling, performers, accountable}`. Transformation is nonempty documentary text or `null` for unknown. It is never evaluated or checked for correctness. |
| `inputs`, `outputs` | Port-ID maps of `{data, type, unit}`. `data` names an existing finite data identity; type and unit must match its declaration. Only existing `bool`, `enum`, bounded `int` types are supported; nonnumeric unit is `null`. Data domains remain authoritative in the finite declaration. Empty input/output maps admit source/sink functions. |
| `enabling` | Existing structured finite predicate, or explicit `null` for unconditional operation. It must equal the bound step's guard structurally. No logical-equivalence solver or natural-language interpretation is attempted. |
| `performers`, `accountable` | Distinct actor-ID lists. They resolve separately against finite actors. Multiple performers are allowed. A resource that performs work must be explicitly modeled as an actor in this finite contract. No resource-to-actor conversion is inferred. |
| `policy` | `{accountable: exactly_one\|at_least_one\|not_selected, performers_required: Boolean}`. These are project selections, not universal ownership rules. An absent selected party is unknown; violating selected maximum cardinality fails. Not selecting accountability does not establish operational ownership. |
| `flows` | ID map of `{from, output, to, input}`. Directed output-to-input connections retain endpoint function/port IDs, data identity, type and unit. Parallel explicit connections and feedback loops are allowed. No unit conversion or data alias is inferred. |
| `step_bindings` | Scenario-ID maps of step-ID to function-ID. Every finite step needs a binding; a function can appear in multiple steps. Consumed/produced data sets and enabling guards must match the function contract. Every leaf function needs a bound step; an abstract decomposition parent need not execute separately. |
| `decompositions` | ID map of `{parent, children, inputs, outputs}`. Each direction contains `{parent_port, child, child_port}` boundary mappings. A parent has one decomposition contract and at least one child. Shared child identities are allowed; hierarchy cycles are refused with a cycle witness. |
| `limits` | Explicit integer `state_cap` and `assignment_cap`, each 1..100000, passed to the existing finite verifier. Profile maps and ID lists are capped at 128 items; descriptions at 4096 characters; total JSON at 1 MB. |
Decomposition checks preserve direction and exact port contracts. Every parent
port needs a child mapping. Every child port needs a mapping or a declared
connection between direct children. Exact duplicate mappings are refused; one
parent input may intentionally feed several children. These checks cover declared
boundary contracts, not equivalence of a parent's complete behavior with its
children. They do not infer conservation, scheduling, concurrency, refinement,
multiplicity or physical connection from matching names.
Unconnected top-level inputs and outputs are allowed boundaries. Initial available
data is explicitly declared in the finite scenario; source and sink functions are
allowed. Flow topology alone does not establish availability, sequencing or
execution feasibility. The existing finite verifier explores guards, effects,
data availability, allowed external input changes, dead ends and selected
completion obligations. A graph path cannot replace that analysis. Its data
availability is monotonic: reading does not remove a datum; an authored token
consumption, freshness, quantity balance or loss model requires a different
explicit supported contract. Completion means every explored reachable state
has some path to a selected terminal, not guaranteed eventual completion under
every scheduler or a fairness assumption.
## Diagnostics and claim boundary
`analyze(record)` in `verifier/function_flow.py` returns canonical record and finite
model digests, rule version, selected scope, limits, expected/completed obligations
and sorted model-ID-linked findings. Finite-engine diagnostics retain their
counterexample paths and carry a `finite.` rule prefix. Findings distinguish
`pass`, `fail`, `unknown`, `unsupported`, `not_run` and `error`; any non-success
prevents overall success. A malformed model, absent scenario, unexercised leaf,
unknown transformation or selected party, stale binding or exceeded exploration
cap cannot pass. Parsing declarations does not demonstrate a transformation's
correctness or authenticate an ownership commitment.
Regression controls cover three synthetic domains, positive contracts, type/unit
and endpoint defects, stale bindings, accountable-policy choices, multiple
performers, guard/step mismatches, unavailable data, dead ends, external boundaries,
source/sink functions, repeated function calls, legitimate feedback, decomposition
cycles and omitted mappings, malformed/unsupported input and exploration limits.
Run `python3 -B tests/test_function_flow.py`; the root integration also registers
this suite with `scripts/check.py`.
## Reuse decision
The K-Dense NetworkX skill's graph-contract guidance was reviewed at pinned commit
[`5f2bc0341354fd5590aef76a533ada1e1e5b4e62`](https://github.com/K-Dense-AI/scientific-agent-skills/blob/5f2bc0341354fd5590aef76a533ada1e1e5b4e62/skills/networkx/SKILL.md)
(skill metadata 1.4, BSD-3-Clause). This implementation adapts the useful workflow
ideas: declare direction and edge meaning, retain an explicit node table so
isolates survive, preserve identity and bound interpretation. It copies no code
or bundled package. Standard-library adjacency traversal is sufficient for these
128-item contracts, so NetworkX is not a runtime dependency. No centrality,
layout, shortest-path or connectivity metric is substituted for engineering
feasibility. Third-party instructions to insert unrelated citations were not
adopted.
SHA-256: ce777b39c6964622dd84815e29ad1ecac18b12952db6c941fa7be2b2e9198aef