vc Filesystem Contract

Purpose of this document

This document describes the observable, filesystem‑level contract of vc, a script change‑control tool.

The goal of this document is not to re‑implement or vendor vc, but to clearly define what our tooling relies on and observes when interoperating with vc.

Important

  • This repository does not include vc source code.
  • This repository does not import or depend on vc internals.
  • All integration is based solely on filesystem behavior and conventions described here.

If vc internals change but this contract remains true, integration remains valid.


What vc is (and is not)

vc is

vc is not

These responsibilities are intentionally handled elsewhere.


High‑level model

vc manages scripts using three concepts:

  1. Working directory
    • The directory where the “active” script is referenced (often via symlink)
  2. DEVELOP directory
    • Where checked‑out copies live while being edited
  3. ARCHIVE directory
    • Where obsolete or superseded versions are stored

Editing a script happens in DEVELOP, not in place.


Base directory layout

DEVELOP and ARCHIVE are per script folder: every folder containing vc‑managed scripts — at any nesting depth — carries its own container subdirectories holding that folder’s checkouts and archived versions:


\<script folder>/
├── myscript.py            (symlink to the active version)
├── myscript.py\_<TS>       (recent checked‑in versions, kept for rollback)
├── DEVELOP/               (this folder's checkouts)
└── ARCHIVE/               (this folder's older versions)

⚠️ The container directory names are environment‑specific and must be treated as configurable in consuming tools.


Checkout semantics

What “checkout” means

A checkout creates a private working copy of a script in the DEVELOP directory.

Observable behavior

Given a script named:


myscript.py

A checkout produces a file in DEVELOP similar to:


myscript.py\_<TIMESTAMP>\_<USER>

Where:

Invariants relied upon


Checkin semantics

What “checkin” means

A checkin:

  1. Moves the edited file from DEVELOP back to the working directory
  2. Updates or creates a symlink representing the active version
  3. Moves older versions to ARCHIVE if retention limits are exceeded

Observable behavior


Version retention

Observable behavior

The retention count is an implementation detail but appears consistently enforced.


Rollback semantics

What “rollback” means

A rollback:

Observable impact

Distinguishing a rollback copy from a real checkout

Both live in DEVELOP and match the same <script>_<timestamp>_<suffix> filename shape, but they mean different things:

Real checkoutRollback‑displaced copy
Suffix<user‑abbreviation>RB_<user‑abbreviation>
MeansSomeone is actively editing thisvc moved a replaced version here

A consuming tool that doesn’t make this distinction will misreport a rollback as an in‑progress checkout by a user named RB_<abbr>.


Obsolete semantics

What “obsolete” means

Marking a script obsolete results in:

After obsoleting:


Template usage

vc supports creating new scripts from templates.

Observable facts:

Template content itself is out of scope for this contract.


Metadata conventions

Many vc‑managed scripts contain structured header comments, commonly using fields like:


@brief
@author
@techowner
@funcowner
@history
@parentfile
@childfile
@inputfile
@outputfile
@paramfile

The last four — @parentfile, @childfile, @inputfile, @outputfile, @paramfile — declare paths to other vc‑managed scripts the script relates to. Consuming tools may treat these as dependency‑edge candidates: a higher‑confidence signal than a path literal inferred from the script body, since the author declared the relationship explicitly. As with any path reference, a value that doesn’t resolve to an indexed script should be dropped rather than surfaced as a dangling edge.

These headers are:

Consuming tools may parse these headers as best‑effort metadata, without assuming they are always present or complete.


Managed-file manifest (optional cross-reference)

vc maintains a flat text file recording every path it manages — one absolute managed file path per line — plus a companion file deriving each entry’s parent directory. Name and location are environment-specific; this repository never hard-codes or names them, treating the concept generically (see VcConfig::manifest_path).

Observed facts:

A consuming tool may optionally cross‑reference this manifest against what it actually indexed, entirely as a best‑effort diagnostic:

This repository does not assume the manifest exists, is current, or is reachable from every host — the cross‑reference is opt‑in and absent by default (see VcConfig::manifest_path).


Invariants this repository relies on

This repository assumes only the following invariants:

Everything else is considered an implementation detail.


Explicit non‑assumptions

This repository does not assume:

Integration must degrade gracefully if vc is unavailable.


Relationship with this repository

vc is treated as:

An external, filesystem‑based change‑control system

This repository:

This separation is intentional and required for long‑term maintainability.


Why we do not vendor or copy vc code

All integration is done via this documented contract.


Change management

If vc behavior changes in a way that breaks this contract:

The document is the single source of truth for integration assumptions.