Reference

Documentation

KNTIC Pulse + @kntic/kntic CLI  ·  v0.10.0

This document covers the KNTIC Pulse orchestration engine — environment configuration, task manifest schema, orchestrator behaviour, and the GIA validation pipeline. For CLI commands (kntic init, kntic start, kntic stop, kntic update), see the @kntic/kntic CLI section below.

Environment Variables

All configuration is done through .kntic.env in your project root. Copy bootstrap-templates/kntic.env as your starting point.

Required

Variable Description
ANTHROPIC_API_KEYAPI key for the AI agent (passed to the agent process at runtime)
UIDHost user ID — prevents volume permission issues. Run id -u to get yours
GIDHost group ID. Run id -g to get yours

.kntic.env is listed in .gitignore and must never be committed to version control.

Required in remote mode (KNTIC_REMOTE_ENABLED=true)

These variables are only required when the orchestrator connects to a remote git repository (the default). When running in local-only mode (KNTIC_REMOTE_ENABLED=false), they can be left empty.

Variable Description
GITLAB_TOKENGitLab personal access token with read/write access to the target repository. Used to authenticate git push/fetch operations and construct the authenticated remote URL.
GIT_HOSTGitLab hostname, e.g. gitlab.example.com. Used for remote URL construction and the dashboard repository link.
GIT_REPO_PATHRepository path including .git, e.g. group/project.git. Used alongside GIT_HOST to build the remote URL (https://oauth2:{token}@{host}/{repo_path}) and to generate the dashboard repository navigation link.

Authentication

Variable Default Description
DASHBOARD_AUTH_TOKEN(empty)Bearer token for dashboard API authentication. When empty, the dashboard runs in open mode and displays a warning banner. Set to a strong random string in production.

Orchestrator

Variable Default Description
KNTIC_REMOTE_ENABLEDtrueWhen false, all git push/fetch/pull operations are skipped. The orchestrator works against a local-only git repository — no GitLab instance required. Incompatible with KNTIC_ORCHESTRATOR_ID (startup will refuse if both are set).
KNTIC_ORCHESTRATOR_ID(auto-generated)Unique UUID identifying this orchestrator instance. Required for multi-orchestrator deployments — used by the optimistic claim protocol to prevent two orchestrators from working the same task.
KNTIC_TARGET_BRANCHmainThe git branch all orchestrator operations target — commits, pushes, and merges all go here.
KNTIC_BRANCH_STRATEGYtrunktrunk: commits directly to KNTIC_TARGET_BRANCH. per-task: creates an isolated branch (kntic/{oid}/{task_id}) per task and merges on GIA pass. Trunk mode is only safe for single-orchestrator deployments.
KNTIC_MERGE_STRATEGYmergeMerge strategy used when KNTIC_BRANCH_STRATEGY=per-task. merge: standard --no-ff merge. ff: fast-forward only (--ff-only).
KNTIC_TASK_FILTER(empty)Comma-separated list of task ID prefixes this orchestrator will claim, e.g. BUG,DASHBOARD. When empty, all tasks are handled.

Agent

Variable Default Description
KNTIC_AGENT_CMDpiThe agent binary or command to invoke. Change this to use a different coding agent — claude, aider, codex, or any CLI agent.
KNTIC_AGENT_ARGS-p {prompt}Argument template for the agent command. {prompt} is replaced with the full task prompt at runtime.
KNTIC_AGENT_PERSISTENTtruetrue: the orchestrator polls the task manifest every 2 seconds and terminates the agent process when a terminal status is detected. false: waits for the agent process to exit naturally.
KNTIC_AGENT_TIMEOUT3600Maximum agent session duration in seconds. If the agent has not set a terminal status within this time, the process is terminated and the task is set to needs_review.

Container Runtime

Variable Default Description
KNTIC_COMPOSE_PROVIDERdocker composeThe compose command used to manage containers. Supported: docker compose (V2 plugin), podman compose, podman-compose (standalone Python).

General

Variable Default Description
TZEurope/ViennaTimezone for all container processes.
KNTIC_VERSION(set by kntic init)Platform version label — set automatically during kntic init and used for version tracking.

Task Manifests

Tasks are defined as JSON files in .kntic/manifests/. The dashboard provides a UI for creating and editing them; you can also write them by hand.

Minimal example

{
  "task_id": "FEAT-001",
  "title": "Add user authentication",
  "status": "todo"
}

Full example

{
  "task_id": "FEAT-001",
  "title": "Add user authentication",
  "description": "Implement JWT-based login and session management.",
  "status": "todo",
  "priority": "high",
  "depends_on": ["INFRA-003"],
  "requirements": {
    "features": [
      "POST /auth/login endpoint returning a signed JWT",
      "Token expiry of 24 hours",
      "401 response on invalid credentials"
    ],
    "files_to_create": ["src/auth.py", "tests/test_auth.py"]
  },
  "context_scope": {
    "read_only": [".kntic/adrs/"],
    "write_access": ["src/", "tests/"]
  },
  "notes": "Use the existing User model in src/models/user.py"
}

Status lifecycle

todo  →  in_progress  →  ready_for_merge  →  merged
               │    ↖
               ▼      └──── refactoring
          needs_review

backlog  →  (human promotes)  →  todo
Status Set by Meaning
todoHumanReady for the orchestrator to pick up
in_progressOrchestratorClaimed — agent is actively working
refactoringAgentGIA failed; agent is self-correcting
needs_reviewAgent / OrchestratorBlocked — human must intervene
ready_for_mergeAgentWork complete; awaiting GIA
mergedOrchestratorGIA passed; changes pushed to git
backlogHumanNeeds refinement before it can become todo

⚠️ The status "done" does not exist. Using it will break orchestration.

Key fields

Field Required Description
task_idUnique identifier, also the filename stem. Conventionally PREFIX-NNN (e.g. BUG-012, FEAT-003).
titleShort human-readable name.
statusCurrent state machine status (see above).
descriptionLonger description of the task goal.
priorityhigh, medium, or low. Affects dispatch order.
depends_onArray of task IDs that must be merged before this task is eligible.
requirementsStructured specification: features, files_to_create, files_to_modify, outputs, security.
context_scopeFiles the agent may access: read_only and write_access path lists.
notesFree-text commentary, blocking reasons, or context for the agent.

Omission rule: fields that are empty must be omitted entirely — never set to null, "", or [].

Orchestrator Behaviour

Pulse loop

The orchestrator runs in a continuous pulse loop (5-second interval). Each pulse processes exactly one task:

  1. ready_for_merge — validate with GIA; merge and push on pass, set refactoring on fail.
  2. todo / refactoring — claim and dispatch to the agent. refactoring always takes priority over todo to prevent a dirty working tree from contaminating the next task.
  3. Idle — no actionable work. After 12 idle pulses (~1 minute), pull latest changes from remote.

Within each category, tasks are sorted by: status rankpriorityoldest updated_at first (FIFO).

Claim protocol (multi-orchestrator)

When multiple orchestrators run against the same repository, the claim protocol prevents conflicts:

  1. Orchestrator writes status: in_progress + claimed_by + claimed_at to the manifest and pushes.
  2. If the push is rejected (another orchestrator pushed first), the claim is abandoned and the task is skipped this pulse.
  3. Stale claims (older than KNTIC_AGENT_TIMEOUT) are detected and reclaimed as needs_review.

GIA — Global Impact Analysis

Before any task is merged, the full GIA hook suite runs against the codebase. GIA produces a weighted alignment score (0.0–1.0). Merge is only allowed when the score meets the configured threshold.

Built-in GIA hooks:

Hook Type Description
001-pytests.shspecificRuns the project test suite
002-bootstrap-sync.shspecificValidates bootstrap template consistency
001-adr-compliance.pyinternalChecks manifest schema, ADR structure, omission rule
998-drift-stale-refs.pyinternalDetects stale file references in MEMORY.MD and ADRs
999-drift-symlinks.pyinternalDetects broken symlinks

When GIA fails, the failure reason, alignment score, dimension breakdown, and hook output are written back to the task manifest (gia_failure field) so the agent knows exactly what to fix on the next attempt.

Custom hooks can be added to .kntic/hooks/gia/specific/ and will be discovered automatically.

Dashboard

The dashboard is available at http://localhost:8000 (or the port configured via KNTIC_UI_PORT).

Features:

  • Live task board with real-time WebSocket updates
  • Create, edit, and manage task manifests through a structured form
  • Per-status and per-prefix filtering
  • GIA health indicator showing the current alignment score
  • Actions audit log per task
  • ADR and documentation viewer
  • Repository link (when GIT_HOST and GIT_REPO_PATH are configured)

Authentication: when DASHBOARD_AUTH_TOKEN is set, all state-mutating API endpoints require a Bearer <token> header. The dashboard login page handles this automatically.

KNTIC CLI — @kntic/kntic

Package: @kntic/kntic · Version: 0.10.0 · Node.js: ≥ 18.0.0 · Platform: Linux (recommended)

The KNTIC CLI bootstraps, configures, updates, and manages projects running on the KNTIC Pulse manifest-driven AI agent orchestration platform. It has zero external dependencies — everything is built with Node.js stdlib.

Installation

npm install -g @kntic/kntic

Or run directly without installing:

npx @kntic/kntic <command>

Commands

kntic usage

Display all available commands and their options.

kntic usage

Running kntic with no arguments also shows the usage screen.

kntic init

Bootstrap a new KNTIC project in the current directory. Downloads the latest bootstrap archive and scaffolds the full .kntic/ directory structure, kntic.yml (Docker Compose file), and .kntic.env (environment configuration).

kntic init              # Interactive mode (default)
kntic init --quick      # Non-interactive mode
kntic init -q           # Short alias for --quick

Modes

Mode Flag Description
Interactive (default)--interactive / -iWalks through every .kntic.env variable, showing the current value as default.
Quick--quick / -qSilent auto-fill. Only auto-detected values are written. No prompts.

What it does

  1. Preflight checks — Verifies the environment (warnings only, never blocks): platform, container runtime (Docker / Podman), GNU screen.
  2. Downloads the latest bootstrap archive from the KNTIC artifact server.
  3. Extracts the archive into the current directory. If a .gitignore already exists, the archive's entries are appended (with a # --- kntic bootstrap --- separator) instead of overwriting.
  4. Auto-detects the git remote by parsing the origin remote URL — supports SSH (git@host:path) and HTTPS (https://host/path) formats. If a glpat-* token is found in the URL, it's extracted into GITLAB_TOKEN. No remote → sets KNTIC_REMOTE_ENABLED=false.
  5. Auto-fills the detected compose provider into KNTIC_COMPOSE_PROVIDER.
  6. Interactive setup (unless --quick): Prompts for each variable in .kntic.env.

Scaffolded structure

your-project/
├── .kntic/
│   ├── lib/            # Orchestrator engine code
│   ├── adrs/           # Architecture Decision Records
│   ├── hooks/
│   │   └── gia/
│   │       ├── internal/   # Built-in GIA validation hooks
│   │       └── specific/   # Project-specific GIA hooks
│   ├── gia/
│   │   └── weights.json    # GIA scoring weights
│   ├── manifests/      # Task manifests (JSON)
│   └── docs/           # Project documentation
├── kntic.yml           # Docker Compose file for KNTIC services
├── .kntic.env          # Environment configuration
└── .gitignore          # Updated with KNTIC-specific entries

kntic update

Update an existing KNTIC project to the latest version. Downloads the latest bootstrap archive and selectively replaces components.

kntic update              # Full update
kntic update --lib-only   # Update only .kntic/lib
kntic update --compose    # Also replace kntic.yml

Options

Flag Description
(no flags)Full update — replaces .kntic/lib, .kntic/adrs, updates .kntic/hooks/gia/internal, bootstraps .kntic/hooks/gia/specific (if not yet present), replaces .kntic/gia/weights.json, and merges new env variables.
--lib-onlyMinimal update — only replaces .kntic/lib. Skips ADRs, hooks, weights, and env merge.
--composeAdditionally replaces kntic.yml from the bootstrap template. The existing file is backed up to kntic.yml.bak first.

Update semantics per component

Component Strategy
.kntic/lib/Replaced — directory is cleared, then freshly extracted.
.kntic/adrs/Replaced — directory is cleared, then freshly extracted.
.kntic/hooks/gia/internal/Updated — existing files are overwritten, new files are added, but files not in the archive are preserved.
.kntic/hooks/gia/specific/One-time bootstrap — only extracted if the directory does not already exist.
.kntic/gia/weights.jsonReplaced if present in the archive.
.kntic.envMerged — new variables from the template are appended. Existing values are never overwritten.
kntic.ymlNot touched unless --compose is passed.
KNTIC_VERSIONAlways updated in .kntic.env to the latest version.

kntic start

Build and start KNTIC services using the configured container compose provider.

kntic start             # Start in foreground
kntic start --screen    # Start inside a GNU screen session

Options

Flag Description
(no flags)Runs <provider> -f kntic.yml --env-file .kntic.env up --build in the foreground.
--screenWraps the compose command in a GNU screen session. Session name from KNTIC_PRJ_PREFIX or current directory name.

Screen behavior

  • If screen is not installed, falls back to foreground mode with a warning.
  • If already inside a screen session (detected via the STY environment variable), skips the screen wrapper and runs in foreground.

The compose command is read from KNTIC_COMPOSE_PROVIDER in .kntic.env. Defaults to docker compose if not set.

kntic stop

Stop running KNTIC services.

kntic stop

Runs <provider> -f kntic.yml --env-file .kntic.env stop using the configured compose provider.

Environment Configuration (.kntic.env)

All runtime configuration lives in .kntic.env at the project root. This file is used by both the CLI and the Docker Compose services.

Variable Description Auto
ANTHROPIC_API_KEYAPI key for the AI agent (Claude)
GITLAB_TOKENGitLab personal access token (glpat-*)
GIT_HOSTGit server hostname
GIT_REPO_PATHRepository path on the git server
UIDHost user ID for container file permissions
GIDHost group ID for container file permissions
TZTimezone (e.g. Europe/Vienna)
KNTIC_VERSIONCurrent KNTIC version (managed automatically)
KNTIC_PRJ_PREFIXProject prefix — used for screen session name and branch naming
KNTIC_UI_PORTPort for the KNTIC dashboard UI
DASHBOARD_AUTH_TOKENAuthentication token for the dashboard
KNTIC_AGENT_CMDCommand to run the AI agent
KNTIC_AGENT_ARGSArguments passed to the agent command
KNTIC_AGENT_PERSISTENTKeep agent process alive between pulse cycles
KNTIC_AGENT_TIMEOUTTimeout (seconds) for agent execution per task
KNTIC_ORCHESTRATOR_IDUnique identifier for this orchestrator instance
KNTIC_BRANCH_STRATEGYGit branching strategy (per-task, etc.)
KNTIC_TARGET_BRANCHTarget branch for merges (e.g. main)
KNTIC_MERGE_STRATEGYGit merge strategy (--no-ff, etc.)
KNTIC_COMPOSE_PROVIDERContainer compose command
KNTIC_REMOTE_ENABLEDWhether git remote operations are enabled

Auto-detected values are filled in during kntic init based on your environment. All values can be overridden manually.

Preflight Checks

During kntic init, the CLI runs non-blocking preflight checks and prints warnings:

Check Warning
Non-Linux platform⚠ Non-Linux detected (<platform>) — KNTIC is designed for Linux, other platforms may have issues
No Docker or Podman⚠ No container runtime found (docker or podman) — required for kntic start
Podman without podman-compose⚠ podman-compose not found — install it via pip install podman-compose
No GNU screen⚠ screen not found — optional, needed for kntic start --screen

These are advisory only — init always proceeds regardless of warnings.

Error Handling

All commands exit with code 1 on failure and print an error message to stderr. Unknown subcommands print the usage screen and exit with code 1.

$ kntic foobar
Unknown command: "foobar"

kntic v0.10.0 — KNTIC CLI
...

Quick Reference

kntic                         Show usage
kntic usage                   Show usage
kntic init                    Interactive bootstrap (default)
kntic init --quick | -q       Non-interactive bootstrap
kntic update                  Full update (lib, adrs, hooks, weights, env)
kntic update --lib-only       Update .kntic/lib only
kntic update --compose        Also replace kntic.yml (with .bak backup)
kntic start                   Start services in foreground
kntic start --screen          Start services in a screen session
kntic stop                    Stop services