feat: support simple projects and root Git repositories

Allow registering a single Git repository at the engineering project root with --path . while retaining path safety checks.

Document Git-optional projects first and cover plain folders, root repositories, and multiple repositories in process tests and native smoke scenarios.

Validated with 23 passing tests and macOS ARM64 native smoke checks for all three layouts.
This commit is contained in:
Nilton Constantino
2026-11-11 16:38:18 +00:00
parent f0e0dd061a
commit e65f216926
10 changed files with 178 additions and 9 deletions
+6
View File
@@ -58,6 +58,12 @@ Context assembly belongs to Verification because it combines independently persi
modules and refuses to export structurally inconsistent state. Work does not depend
on Discussion, Decision or Artifact, avoiding cycles. It owns stable references only.
The engineering project is independent of repository count: a plain folder can use
the protocol with no Git dependency, a single Git repository can register the root
using `.`, and a larger workspace can register several child repositories. The same
configuration schema and services support each case; no separate project mode or
additional repository type is needed.
## Persistence and native execution
Writers take an OS file lock per project. Complete UTF-8 files are written to a sibling
+25
View File
@@ -132,6 +132,31 @@ JAVA_HOME=/nonexistent GRAALVM_HOME=/nonexistent PATH=/usr/bin:/bin:/usr/sbin:/s
bash scripts/native-smoke.sh "$PWD/build/native/nativeCompile/ai-engineering"
```
## H5 — Simple projects and a single root repository
A simple project can initialize `.ai-engineering` directly beside its existing source
files. Repository registration is optional; a project with no registered repositories
has a complete Work/discussion/decision/artifact workflow and no Git revision snapshots.
The separate-process test runs those commands with no Git on PATH, reconstructs the
same context, validates the project and confirms no `.git` or source changes appear.
For projects already using one Git repository, `repo add app --path .` now registers
the root repository. A test-first run reproduced the earlier root-path rejection;
removing that restriction preserves traversal, symlink and `.ai-engineering` exclusions.
Regression tests confirm read-only defaults, nested discovery, deterministic context,
duplicate-path rejection and unchanged Git configuration/source content. Existing
multi-repository and real-submodule fixtures still pass.
Result: **23 tests, 0 failures, 0 errors, 0 skipped** on the SDKMAN GraalVM CE toolchain.
The native smoke script now exercises all three layouts: no Git, a single root Git
repository, and multiple child Git repositories. The README starts with the simple
project workflow. These changes do not require a new configuration schema or project
mode.
Native compilation succeeded on macOS ARM64. With `JAVA_HOME` and `GRAALVM_HOME`
pointing to nonexistent paths, the expanded smoke passed both the simple-project
scenarios (including no Git on PATH) and the multi-repository scenario.
## Limits and next experiment
CI workflows are provided but have not been executed from this local workspace.
+15 -2
View File
@@ -6,6 +6,18 @@ The engineering root is the parent of `.ai-engineering`. Repository paths resolv
against that root, independently of the CLI's current directory. Discovery searches
upward or accepts an explicit `--project` root (or `.ai-engineering` directory).
An engineering project may be a simple source folder without Git, one Git repository,
or a workspace containing several repositories. All three use the same Work protocol.
Initialize directly in the folder that represents the desired project scope. An empty
`repositories: []` is valid; Works need no repository references to persist discussions,
decisions, artifacts and context. Git is invoked only when inspecting registered
repositories. Without repository references, a Work has no Git revision snapshots.
For a single Git repository at the engineering root, register it with `path: "."`
and `type: linked-git`. Registration remains explicit; initialization does not create
or register a Git repository. For multiple repositories, register their relative
subdirectory paths as in the example below.
```yaml
schemaVersion: 1
project:
@@ -30,8 +42,9 @@ never executable through this release. Unknown fields and schema versions fail v
Absolute repository paths, `..` components, backslashes and symlinks beneath the root
are rejected, including links that point inside the root. This stricter initial rule
avoids ambiguous link policies. Repositories cannot be the engineering root or live
inside `.ai-engineering`. Git inspection verifies an independent repository top-level;
avoids ambiguous link policies. A linked Git repository may be the engineering root;
repositories cannot live inside `.ai-engineering`. Git inspection verifies the registered
path is a repository top-level;
submodule registration additionally verifies its superproject. Paths must exist.
No submodules are automatically created, moved or updated.
+5
View File
@@ -16,6 +16,11 @@ discussion history, draft DECs, evidence integrity, structural validation and st
Markdown/JSON context. Temporary-fixture tests cover continuity, independent Works,
multiple repositories and malformed/missing/unsafe state.
Simple projects are supported directly: initialize in an existing source folder
without Git, or register a single existing Git repository using `repo add app --path .`.
No enclosing workspace or additional repositories are required. Regression coverage
includes fresh processes without Git on PATH and single-repository root discovery.
Acceptance demonstration: initialize a project with two independent Git repositories,
create a Work referencing both, append discussion, persist a draft decision and
evidence, export context, then reconstruct the same context in independent processes