Portable Duty Watch Adoption
Intentloom must be able to adopt an existing repository without erasing its working agreements, project state, history, or provider-specific instructions.
Applye is the first reference consumer for this workflow.
Goal
A project owner should be able to run an Intentloom adoption or update and receive a reviewable proposal instead of an automatic rewrite.
The system must inspect the repository, identify existing governance, detect overlap and drift, propose improvements, and apply only explicitly approved changes through a reversible transaction.
Core rule
Adoption is analysis first, proposal second, mutation last.
Intentloom must never assume that its default file names are the only valid structure. For example, an existing docs/product/CURRENT_STATE.md may already fulfil the role of PROJECT_STATE.md. In that case the proposal should preserve it and map the canonical role instead of creating a duplicate.
Adoption lifecycle
Discover
- detect repository type, languages, frameworks, package managers, applications, libraries, CI, Git hooks, provider instruction files, skills, state files, changelog, roadmap, ADRs, security policy, and validation commands;
- inspect current Intentloom ownership metadata when already adopted;
- perform no writes and no dependency installation.
Classify
- assign discovered files to canonical roles such as agent entrypoint, durable context, operational state, duty log, roadmap, changelog, validation matrix, provider adapter, generated derivative, user-owned content, or unknown;
- attach confidence and evidence to every classification;
- mark ambiguous cases for human review.
Compare
- compare the repository with the selected Intentloom pack and its installed version;
- detect missing capabilities, equivalent files, exact duplicates, semantic overlap, conflicts, stale generated files, local customizations, obsolete rules, broken references, and unsupported commands;
- distinguish safe additions from destructive or policy-changing changes.
Propose
- produce an adoption plan containing each proposed operation, reason, evidence, risk, ownership result, preview diff, validation requirement, and rollback behavior;
- present alternatives when more than one structure is reasonable;
- recommend consolidation when duplicate sources of truth exist;
- never silently choose between conflicting user-owned files.
Approve
- support approve all, approve selected, reject, defer, edit mapping, keep local, replace generated, merge manually, or mark as intentional exception;
- require explicit confirmation for deletes, renames, replacements, hooks, dependencies, network access, secret-related changes, executable configuration, CI changes, or security policy changes.
Apply
- create a backup or transaction snapshot;
- apply only approved operations;
- preserve user-owned sections and local overrides according to ownership markers;
- never modify unrelated files.
Validate
- run project-specific formatting, lint, type, test, build, security, compatibility, and native/manual gates selected from repository evidence;
- report checks as passed, failed, skipped, unavailable, or manual-required;
- do not claim successful adoption while required checks fail.
Record and hand off
- update the project state mapping, installed pack version, ownership manifest, migration journal, and Duty Watch entry;
- record accepted exceptions and deferred proposals so the next update does not ask the same question without new evidence.
Duplicate handling
Intentloom should classify duplication into four categories:
- Exact duplicate: identical or generated-equivalent content. Recommend one canonical source and safe removal of the redundant derivative.
- Role duplicate: two files claim the same source-of-truth role. Recommend consolidation, aliasing, or an explicit precedence rule.
- Partial overlap: files share some rules but also contain unique material. Propose a section-level merge and show what would move.
- Intentional provider derivative: files such as
CLAUDE.mdor tool rules repeat canonical policy for compatibility. Keep them as generated adapters and detect drift rather than deleting them.
No duplicate may be deleted solely because its filename resembles an Intentloom default.
Update lifecycle
When Intentloom or a pack is updated, the same lifecycle applies. The update compares:
- previously installed canonical version;
- current repository state;
- new pack version;
- recorded local overrides and accepted exceptions.
This is a three-way migration, not a blind overwrite.
For every changed pack item, classify the result as:
- unchanged upstream;
- safe fast-forward;
- local-only customization;
- upstream-only addition;
- clean semantic merge;
- conflict requiring approval;
- deprecated item with migration path;
- removed item retained locally by choice.
Required safety properties
- dry-run and machine-readable plan before writes;
- stable operation identifiers so approvals can be audited;
- content hashes and expected-current-state checks to prevent stale-plan writes;
- atomic transaction or full rollback;
- no hidden network calls, telemetry, hooks, dependencies, commits, pushes, PRs, merges, or releases;
- secret redaction in reports and logs;
- path traversal and symlink boundary protection;
- project-root isolation;
- deterministic output for identical repository state and pack version;
- idempotency: running adoption again after a successful apply produces no new changes;
- interruption recovery with a transaction journal;
- explicit unsupported and manual-review states instead of guessing.
Reference consumer: Applye
Applye already has mature AIF-era governance. Its intended role mapping is:
AGENT_START_HERE.md: agent entrypoint;AGENTS.md: canonical repository working agreement;PROJECT_CONTEXT.md: durable product and architecture context;docs/product/CURRENT_STATE.md: operational project state;DUTY_WATCH.md: chronological handoff log;docs/governance/VALIDATION_MATRIX.md: project-specific validation policy;CLAUDE.md: Claude provider derivative;ROADMAP.md,STEP_BY_STEP_PLAN.md, andCHANGELOG.md: existing canonical planning and history documents.
An Applye adoption must therefore map and enhance these files, not create competing defaults.
Engineering Duty Watch and operational safety
Proposed product direction; not an implemented monitoring service. Extend the existing portable handover concept with an operational watch for a software factory, inspired by engineering rounds and protective automation. The existing repository duty log remains a handover source, not a telemetry database. Preserve adopted project-owned log mappings; export concise reviewed summaries rather than rewriting the existing history.
Watch assignment and inspection
A project owner configures watch scopes, responsible human or agent roles, delegation, shift schedule and time zone, inspection checklist, evidence sources and escalation policy. Morning/evening rounds are examples, not mandatory hours. Manual rounds and offline evidence import are first. Later scheduling must be opt-in, bounded, and explicit about missed or overlapping runs, daylight-saving changes, downtime, cancellation and unavailable sources. It must not pretend to run while the local host is off.
Reuse existing Project Doctor, security audit, quality/conformance, task graph, provider and release evidence. Candidate read-only connectors can observe service health, latency, errors, database and queue saturation, backup/restore evidence, deployments, CI, agent task health, budget usage and security alerts. Prometheus, Grafana-compatible sources or existing provider monitoring may supply evidence; do not build a replacement observability stack or assume these integrations are implemented.
Each inspection record includes stable watch/run ID, project/environment, responsible actor and role, checklist/policy revision, timestamps, observed values with units and source provenance, severity and freshness, missing or unavailable observations, related incidents/actions and handover status. Preserve append-only history or equivalent auditable corrections. Never report healthy when a required observation is stale, absent or unsupported. The receiving watchkeeper acknowledges the handover and unresolved items; acknowledgement is not remediation or an approval.
Alarms, incidents and safety guards
Scheduled rounds complement, rather than replace, event-driven detection. Ingest provider alerts through approved read-only connectors and route them using existing responsibility, inbox, notification and work graph boundaries. Track open, acknowledged, mitigated and resolved incidents; deduplicate alerts and escalate unacknowledged critical events. Resolution requires verified evidence and, where required, independent human review.
Separate observation, notification, protection and recovery. Warning and critical thresholds are project/environment-specific, versioned and reviewed, with units, evaluation windows, freshness, hysteresis or cooldown, and explicit unknown state. Use deterministic evaluation for enforcement; AI may explain findings, suggest runbooks and draft incident tasks, but does not choose or bypass safety limits during execution.
Existing local runtime capability, time, concurrency and budget constraints remain authoritative. Candidate safeguards include denying an unauthorized tool or write, suspending new agent dispatch, bounded cancellation of an affected task, retry caps and a manual emergency stop. Never imply that a stop can undo completed external side effects. Preserve in-flight transaction integrity, evidence, and recovery state. Resuming requires fresh validation and a reviewed authorization where policy requires it.
Production circuit breakers, failover, traffic shedding or rollback belong to the affected service or provider-native control plane. Intentloom first observes their state. A later integration may invoke a narrowly scoped, explicitly preauthorized deterministic protective action only after separate Design First approval, threat review and sandbox proof. Define blast radius, idempotency, rate limits, recovery, escalation and safe failure. No generic shell, self-approved deployment, automatic production restart, data deletion or unrestricted remediation is authorized. Safety-critical enforcement must not depend on an LLM, UI, network connection or a scheduled AI round.
Preventive maintenance and privacy
Turn recurring evidence-backed findings into reviewed maintenance tasks: dependency and certificate expiry, backup verification, recurring CI failures, resource saturation, security drift and agent cost anomalies. Assign an owner and due date through the existing work graph; distinguish suggestion from approved work. Keep secrets and personal activity out of logs, enforce least privilege, retention and scope separation, and prohibit individual productivity surveillance.
The staged plan and exit gates are maintained in the enterprise delivery extension. Detailed contracts, state transitions, scheduling, persistence, provider adapters and protective actions require separate Design First review.