markharness

Product Operation Overview: File Creation Order and Use Cases

Status: Draft (a translation of the paper’s design into a product operation overview. Some parts, such as the 3 commands under UC5, are already implemented in the CLI) Related documents: A Git-Native Model for Test Knowledge Management: Integrated Edition (the paper this document translates), cli-manual.md (implementation details of the commands corresponding to each UC)

Positioning: This document translates the design of the paper “A Git-Native Model for Test Knowledge Management: Integrated Edition” (git-native-model-for-test-knowledge-management.md) into the operational picture of actually running it as a product. Where a point is explicitly stated in the body of the paper, the corresponding section and line number are noted; where a point was supplemented for productization, it is explicitly marked “(productization proposal, not stated in the paper body)”.


1. File creation order (sequence diagram)

sequenceDiagram
    actor TD as Test Designer
    participant KN as .markharness/knowledge/**
    actor RM as Release Manager
    participant CI as CI Bot
    participant GEN as .markharness/generated/testcases/*.yml
    participant CH as .markharness/changes/milestone.yaml
    participant BF as Backfill Worker
    participant NOTES as git notes

    TD->>KN: Write feature.yml
    TD->>KN: Write condition.yml
    TD->>KN: Write expected/*.yml
    TD->>KN: Manually write forked_from (only when there is a conceptual derivation, §3.1)
    TD->>CI: Create PR

    CI->>GEN: Deterministically regenerate TestCase from Feature+Condition
    CI->>CI: Verify that the regenerated result matches the current files (§4.5)
    alt Diff exists
        CI-->>TD: Request diff review (human judgment point)
    else No diff
        CI-->>TD: Verification OK
    end

    RM->>KN: Assign milestone tag (human judgment point)
    RM->>CI: Notify of tag push

    CI->>CH: Compute derived_from by comparing the Feature directory tree SHA between the two most recent milestones (§3.2-3.4, core contribution)
    CI->>NOTES: Record "lineage computation for this milestone is complete" (§4.3)

    par Asynchronous background
        BF->>NOTES: Check unprocessed past milestones
        BF->>CH: Backfill past .markharness/changes/*.yaml as a low-priority job (§4.1-4.2)
        BF->>NOTES: Record processed milestones
    end

    Note over CI,CH: Any interval whose backfill is not yet complete at query time is computed on demand and cached (§4.4)

Key points of the creation order

  1. .markharness/knowledge/**/feature.ymlcondition.ymlexpected/*.yml (manually written by the Test Designer)
  2. .markharness/generated/testcases/*.yml (deterministically generated by CI, and verified to match the existing files)
  3. Milestone tag (assigned by the Release Manager as a human judgment)
  4. .markharness/changes/<milestone>.yaml (CI automatically computes derived_from)
  5. Progress recorded in git notes → delayed backfilling of past milestones (asynchronous, automatic)

2. Use case diagram

Since mermaid has no UML use case diagram, actors are represented as nodes and use cases as rounded nodes (a visual substitute).

flowchart LR
    subgraph Actors
        TD[Test Designer]
        RV[Reviewer]
        RM[Release Manager]
        CIBOT((CI Bot))
        BFW((Backfill Worker))
        MIG[Data Migration Operator]
    end

    subgraph UseCases
        UC1(("UC1: Write knowledge"))
        UC1b(("UC1b: Manually write forked_from"))
        UC2(("UC2: Deterministically generate TestCase"))
        UC3(("UC3: Review and merge generated artifacts"))
        UC4(("UC4: Tag a milestone"))
        UC5(("UC5: Automatically compute ChangeEvent"))
        UC6(("UC6: Run backfill asynchronously"))
        UC7(("UC7: Discard and rebuild the id cache"))
        UC8(("UC8: Import from an existing tool"))
    end

    TD --> UC1
    TD --> UC1b
    TD --> UC7
    RV --> UC3
    RM --> UC4
    CIBOT --> UC2
    CIBOT --> UC5
    CIBOT --> UC7
    BFW --> UC6
    MIG --> UC8

    UC1 -.include.-> UC2
    UC2 -.include.-> UC3
    UC4 -.include.-> UC5
    UC5 -.include.-> UC6

3. Use case descriptions

# Use case Actor Trigger Precondition Main flow Postcondition Human involvement
UC1 Write knowledge Test Designer Addition of a new feature/new condition None Create and commit feature.yml/condition.yml/expected/*.yml .markharness/knowledge/ is updated Manually written (§3.1, line 108)
UC1b Manually write forked_from Test Designer A conceptual derivation from another Feature occurs The source Feature exists Write the source id into the forked_from field Domain knowledge that does not appear in Git history is made explicit Mandatory manual entry (cannot be automatically derived from Git history, line 153)
UC2 Deterministically generate TestCase CI Bot PR creation/push feature.yml/condition.yml exist Mechanically scan the Feature+Condition pairs and regenerate .markharness/generated/testcases/*.yml The generated artifacts come to match the latest knowledge Automatic (no human intervention). However, the diff-verification result against existing files is presented to a human (§4.5, line 316)
UC3 Review and merge generated artifacts Reviewer UC2 complete, diff detected CI has detected a diff Review the diff content, judge whether it is an intended change, and merge .markharness/generated/testcases/*.yml is finalized and integrated into main Human judgment point: the final gate that prevents unintended changes from slipping in
UC4 Tag a milestone Release Manager Release decision The main branch is stable Run git tag <milestone> The milestone boundary is finalized Human judgment point: the release-timing decision itself (Figure 3)
UC5 Automatically compute ChangeEvent CI Bot Tag push A tag for the immediately preceding milestone exists Between the two milestones, compare the Feature directory tree SHA for each id resolved via the id resolution, compute derived_from, and write it to .markharness/changes/<milestone>.yaml The version history (ChangeEvent) is generated Automatic (core contribution, §3.2-3.4). change_type is not written; a human fills it in afterward, as described in Supplement 6 below
UC6 Run backfill asynchronously Backfill Worker UC5 complete, or a query against an unprocessed interval An unprocessed interval exists in git notes Compute the past lineage starting with priority given to the most recent milestone, recording to git notes upon completion of each .markharness/changes/*.yaml for past milestones is filled in incrementally Automatic. However, the operator can configure processing-priority adjustments (productization proposal, not stated in the paper body)
UC7 Discard and rebuild the id cache Test Designer / CI Bot Suspected cache inconsistency An id-resolution cache exists Run the --no-cache option or the rebuild command The cache is rebuilt Explicit manual discard (fail-safe, line 199)
UC8 Import from an existing tool Data Migration Operator Migration of existing TestRail/Xray/TestLink assets, or of existing Gherkin (.feature) assets An export file, or .feature files, have been prepared Run the importer to convert to this format (the .markharness/knowledge/ structure) Existing assets are reflected under .markharness/knowledge/ Manual trigger (the migration work itself is carried out by a human, §4.5). See the supplement below for the scope of Gherkin import

4. Supplement: items out of the paper’s scope

5. Supplement: implementation of “where execution results are recorded” for UC4 (not stated in the paper body, productization proposal)

The main flow of UC4 (running git tag <milestone>) itself remains unchanged as a human judgment point, but two commands have been implemented to assist the subsequent mechanical work of “recording execution results into .markharness/executions/” (docs/cli-manual.md §1.13/1.14).

6. Supplement: the 3 commands accompanying UC5 “Automatically compute ChangeEvent” (productization proposal, not stated in the paper body)

The main flow of UC5 (markharness changes compute) itself is unchanged, but three commands have been implemented to assist the parts that §3.2 and §3.5 of the paper position as “entered by a human afterward” or “an auxiliary function for auditing” (docs/cli-manual.md §1.15-1.17).