markharness

ChangeEvent-linked Execution Status Tracking (Verification Status Tracking) Specification

Status: Implemented(markharness verify trace / markharness verify pending) Related documents: git-native-model-for-test-knowledge-management.md (hereafter “the paper”), gap-analysis-mh-sample-test-case.md Intended audience: Implementers of markharness (or its successor tools)

Positioning: This document is an additional specification that concretizes the “execution-result-side linkage” portion of the “identify impacted TestCases starting from a ChangeEvent → re-verify” concept envisioned in Section 3.5 and Figure 4 of the paper. The paper treats automatic generation of ChangeEvents and identification of impacted_testcases as its core contribution, while a mechanism to automatically determine “whether it was actually re-executed afterward” was an undecided area corresponding to Chapter 7 (Future Work). This document specifies that area.


1. Problems to Solve

This addresses two questions that the current implementation (the MM folder) cannot answer automatically, but that are inevitably asked in operation.

In the current implementation, executions/<milestone>/results.yml holds only case_id / result / executor / executed_at, and cross-checking against the impacted_testcases in changes/<from>-<to>.yaml is done visually by a human. This cross-check is to be automated.


2. Data Model Extension

2.1 Adding a Field to TESTEXECUTION

The following is added to TESTEXECUTION in the ER diagram of the paper (Section 3.1).

# One record in executions/<milestone>/results.yml
case_id: tc-edit-existing-todo-001
result: pass
executor: soreiyu52
executed_at: 2026-08-08T16:38:52Z
verified_feature_tree_shas:        # added field
  todo-edit: 4f2c9a1e8b3d5670012ab34cd56ef7890a1b2c3

2.2 TESTCASE’s generated_from Is Used As-Is

Since generated/testcases/*.yml’s generated_from.feature (e.g. todo-edit) already holds the Feature id, it can be reused as the key for verified_feature_tree_shas. No schema change is needed.

2.3 No resolved State Is Added to ChangeEvent

The design of giving ChangeEvent (changes/*.yaml) itself a “re-verified flag” is not adopted. Reasons:

2.4 Recomputation Modes for impacted_testcases (--historical default / --current-tree)

As of 2026-08, impacted_testcases written by changes compute has two modes.

For the cross-check with verified_feature_tree_shas in Section 2.1 (Q2 in Section 3.2), the set of impacted_testcases written to changes/*.yaml is used as-is as Impacted, so note that if changes/*.yaml computed with --current-tree is later recomputed with --historical (default), the Impacted set itself may change. For operations that require reproducibility (the pending/stale determination premised on this section), use the default historical mode.


3. Determination Algorithm

3.1 Q1: Which Change Does This Result Reflect Execution After?

Input: case_id, milestone (target TestExecution record)

  1. Retrieve verified_feature_tree_shas of the target record from results.yml.
  2. For each Feature id, search all ChangeEvent records under changes/ for to_tree_sha == verified_feature_tree_shas[feature_id].
  3. Return the matching ChangeEvent’s event_id, from_milestone, and to_milestone as “the change this result reflects.”
  4. If no matching ChangeEvent is found (i.e., there was no change to the target Feature at that milestone), trace back along the most recent derived_from chain and return “the last milestone at which a change occurred.”

Example output:

$ markharness verify trace tc-edit-existing-todo-001 --milestone test2
case_id: tc-edit-existing-todo-001
feature: todo-edit
executed_at: 2026-08-08T16:38:52Z
reflects_change: todo-edit--test1--test2
  from_milestone: test1
  to_milestone: test2
  change_type: (not yet recorded; will display if entered afterward via markharness changes annotate)

3.2 Q2: Which TestCases Were Changed but Not Yet Executed?

Input: from_milestone, to_milestone (the milestone range to compare; the most recent adjacent pair if omitted)

  1. Read all ChangeEvents for the target range from changes/<from>-<to>.yaml and build a unified set Impacted from their impacted_testcases.
  2. Scan results.yml for to_milestone onward (including to_milestone itself and all subsequent milestones), and for each case_id, consider it “re-verified” if there is even one record satisfying verified_feature_tree_shas[feature_id] == changes[event].to_tree_sha.
  3. Output Impacted - re-verified set as “not re-executed.”
  4. If the target Feature has been further changed after to_milestone (i.e., to_tree_sha is already stale), list it separately under the category “the target itself has become stale” rather than “not re-executed” (Section 3.3).

Example output:

$ markharness verify pending --from test1 --to test2
pending (not re-executed):
  - tc-edit-existing-todo-001  (impact of todo-edit change test1->test2, not executed)

stale (impacted scope has changed further):
  (none)

3.3 Distinguishing “pending” from “stale”

When Q2 is operated across milestones, cases will inevitably arise where “the target Feature changed further before it could be re-executed.” If these are all uniformly treated as “not executed,” testers lose track of “which version they should be verifying against.” Hence the two categories.

Determination: For the target Feature id, check via the id_index cache whether the to_tree_sha of the ChangeEvent that generated the Impacted set matches the current tree SHA (at query time). If it matches, pending; if not, stale.


4. Tool Interface Specification

The following two commands are implemented as CLI subcommands of the markharness main body.

Command Purpose Corresponding question
markharness verify trace <case_id> --milestone <m> Shows which ChangeEvent the specified execution result reflects Q1
markharness verify pending [--from <m1> --to <m2>] Shows a list of not-yet-re-executed / stale TestCases Q2

5. Trace Example with Existing MM Implementation Data

Reconstructing the current changes/test2.yaml and executions/test2/results.yml per this specification gives the following (verified_feature_tree_shas is assumed to be attached starting from newly executed records after this spec is introduced, and is not applied retroactively to existing records; see Chapter 6. to_tree_sha is the tree SHA of the entire Feature directory, and its value changes upon re-running changes compute. The values below are illustrative).

# changes/test2.yaml (illustrative; actual values will differ once tree-SHA-based)
- event_id: todo-edit--test1--test2
  feature_id: todo-edit
  from_milestone: test1
  to_milestone: test2
  from_tree_sha: null
  to_tree_sha: 4f2c9a1e8b3d5670012ab34cd56ef7890a1b2c3
  impacted_testcases:
  - tc-edit-existing-todo-001
# executions/test2/results.yml (form after this spec is introduced)
- case_id: tc-edit-existing-todo-001
  result: pass
  executor: soreiyu52
  executed_at: 2026-08-08T16:38:52Z
  verified_feature_tree_shas:
    todo-edit: 4f2c9a1e8b3d5670012ab34cd56ef7890a1b2c3

Cross-checking these two, since to_tree_sha matches verified_feature_tree_shas.todo-edit, markharness verify pending --from test1 --to test2 does not treat tc-edit-existing-todo-001 as pending, and correctly determines it as “re-verified.”


6. Introduction / Migration Policy


7. Threats / Points of Note