Luigit
repositories / termux-janitor

termux-janitor

Interactive cleanup assistant for Termux: transparent, safe, confirmed disk reclamation.

owned by admin

tools/spec-engine/spec/PROFILE.md

Raw
Rendered preview

Profile contract

The engine consumes exactly one module named profile, supplied by the consuming repository through build.zig. Everything the engine knows about a specific repository arrives this way.

Required declarations

pub const Suite = enum { ... };                  // verification lanes, including a wildcard
pub const concrete_suites: []const Suite;
pub const wildcard_suite: Suite;
pub fn suiteMatches(required: Suite, observed: Suite) bool;
pub fn suiteIsConcrete(suite: Suite) bool;
pub fn suiteRunsLocally(suite: Suite) bool;
pub fn requirementIdValid(id: []const u8) bool;  // requirement identifier grammar

pub const tool_invocation: []const u8;           // how the tool is invoked, without a subcommand
pub const generate_command: []const u8;          // command that rewrites generated documents
pub const verify_command: []const u8;            // command that proves a fix
pub fn requirementOwnerLink(owner: []const u8) []const u8;

pub const paths = struct {
    pub const documents, concepts, requirements: []const u8;
    pub const test_specs, verification, implementations, test_bindings: []const u8;
    pub const fixture_root, binding_root, binding_inventory_root: []const u8;
    pub const implementation_root, implementation_inventory_root: []const u8;
    pub const agents, requirements_index, glossary: []const u8;
};

pub const projections = struct {
    pub const glossary_preamble: []const u8;
    pub const requirements_preamble: []const u8;
};

Rules

SE-PROF-01. The profile is data and pure predicates. It performs no I/O, holds no state, and imports nothing from the engine.

SE-PROF-02. The engine may read profile declarations at any point. The profile may never read engine state, so there is no cycle.

SE-PROF-03. A repository-specific string that would otherwise be embedded in an engine message, path check, or projection belongs in the profile. Engine sources contain no repository path, product name, or requirement prefix.

SE-PROF-04. Product registries are not part of the profile. A consumer validates, queries, and renders its own registries and composes them with the engine at its executable entry point.

SE-PROF-05. concrete_suites enumerates every non-wildcard suite exactly once. wildcard_suite identifies the suite rejected for executable test specs and obligations. suiteRunsLocally classifies concrete suites for build-gate placement.

# Profile contract

The engine consumes exactly one module named `profile`, supplied by the consuming repository through
`build.zig`. Everything the engine knows about a specific repository arrives this way.

## Required declarations

```zig
pub const Suite = enum { ... };                  // verification lanes, including a wildcard
pub const concrete_suites: []const Suite;
pub const wildcard_suite: Suite;
pub fn suiteMatches(required: Suite, observed: Suite) bool;
pub fn suiteIsConcrete(suite: Suite) bool;
pub fn suiteRunsLocally(suite: Suite) bool;
pub fn requirementIdValid(id: []const u8) bool;  // requirement identifier grammar

pub const tool_invocation: []const u8;           // how the tool is invoked, without a subcommand
pub const generate_command: []const u8;          // command that rewrites generated documents
pub const verify_command: []const u8;            // command that proves a fix
pub fn requirementOwnerLink(owner: []const u8) []const u8;

pub const paths = struct {
    pub const documents, concepts, requirements: []const u8;
    pub const test_specs, verification, implementations, test_bindings: []const u8;
    pub const fixture_root, binding_root, binding_inventory_root: []const u8;
    pub const implementation_root, implementation_inventory_root: []const u8;
    pub const agents, requirements_index, glossary: []const u8;
};

pub const projections = struct {
    pub const glossary_preamble: []const u8;
    pub const requirements_preamble: []const u8;
};
```

## Rules

**SE-PROF-01.** The profile is data and pure predicates. It performs no I/O, holds no state, and
imports nothing from the engine.

**SE-PROF-02.** The engine may read profile declarations at any point. The profile may never read
engine state, so there is no cycle.

**SE-PROF-03.** A repository-specific string that would otherwise be embedded in an engine message,
path check, or projection belongs in the profile. Engine sources contain no repository path, product
name, or requirement prefix.

**SE-PROF-04.** Product registries are not part of the profile. A consumer validates, queries, and
renders its own registries and composes them with the engine at its executable entry point.

**SE-PROF-05.** `concrete_suites` enumerates every non-wildcard suite exactly once. `wildcard_suite`
identifies the suite rejected for executable test specs and obligations. `suiteRunsLocally` classifies
concrete suites for build-gate placement.