Skip to content

fix(verify)!: inline implementsのrefinement_failedをtop-level成功・exit 0で返す #1002

Description

@rizumita

Problem

An inline implements refinement can return refinement_failed while both
fslc check and fslc verify keep a successful top-level result and exit code 0.

This is a false green: a consumer that follows the documented process-exit contract or reads only
the top-level result accepts a requirements layer that does not refine its business contract.

Environment

  • release: fslc 4.4.1
  • latest main: dbbf6889a0c1f3001552952ffc537632a01f8188 (also reproduced)
  • observed on: macOS arm64

Minimal reproduction

override-business.fsl:

business OverrideBusiness {
  actor Operator
  entity Item

  process Item {
    stages Ready, Done
    initial Ready
    transition finish Ready -> Done by Operator
  }
}

verify { instances Item = 1 }

override-broken-requirements.fsl:

requirements OverrideBrokenRequirements {
  process Item {
    stages Ready, Done
    initial Ready
    transition finish Ready -> Done by Operator
  }

  implements OverrideBusiness from "override-business.fsl" {
    maps auto
    action finish(c) -> stutter
  }
}

verify { instances Item = 1 }

The implementation action changes the mapped abstract item_stage, but is declared as stutter.

$ fslc check override-broken-requirements.fsl --strict-tags
{
  "result": "ok",
  "implements": {
    "result": "refinement_failed",
    "violation": {"kind": "stutter_changed_abs"}
  }
}
$ echo $?
0

$ fslc verify override-broken-requirements.fsl --depth 2 --strict-tags --no-cache
{
  "result": "verified",
  "implements": {
    "result": "refinement_failed",
    "violation": {"kind": "stutter_changed_abs"}
  }
}
$ echo $?
0

Expected

A failed inline refinement makes the whole command non-successful:

  • top-level result must not be ok / verified; and
  • process exit must be 1 (property/contract not satisfied), or another documented non-zero class.

The nested violation should remain available as evidence.

Acceptance criteria

  • check fails closed when inline implements.result == refinement_failed.
  • verify fails closed for the same condition.
  • Top-level result, nested result, and process exit cannot contradict each other.
  • A valid maps auto control remains successful.
  • Native full-envelope and exit-code tests cover both controls.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-discoveredIssues created from scoped follow-up discoverybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions