feat: add offline cross-project Requests and Work incorporation
build / jvm (push) Waiting to run
build / native (macos-15, macos-arm64) (push) Waiting to run
build / native (ubuntu-24.04, linux-x86_64) (push) Waiting to run
build / native (windows-2025, windows-x86_64) (push) Waiting to run
Test / Tests and coverage
Intrepid/AI Engineering/pipeline/head This commit looks good
build / jvm (push) Waiting to run
build / native (macos-15, macos-arm64) (push) Waiting to run
build / native (ubuntu-24.04, linux-x86_64) (push) Waiting to run
build / native (windows-2025, windows-x86_64) (push) Waiting to run
Test / Tests and coverage
Intrepid/AI Engineering/pipeline/head This commit looks good
This commit is contained in:
@@ -39,6 +39,7 @@ POST operations. See [event protocol](local-server-sse.md).
|
||||
| artifact | Temporary payloads, lifecycle, publication recovery and typed receipts | work, filesystem |
|
||||
| agent | Proposal adapters, bounded local transport, validation and application | project, work, discussion, decision, planning, artifact, filesystem |
|
||||
| legacyimport | Explicit DF preview/import, preserved originals and provenance | filesystem, project, work, discussion, artifact |
|
||||
| request | Offline textual inbox and recoverable incorporation into Work discussion context | filesystem, project, work, discussion |
|
||||
| verification | Integrity/readiness, gates, snapshots, coordination, migration and context | protocol modules |
|
||||
| cli | Picocli commands and presentation | public module APIs |
|
||||
| localserver | Private process identity/locks, HTTP client/server, invocation jobs, durable outcomes | cli, filesystem, project |
|
||||
@@ -77,6 +78,15 @@ waiting. Ordinary related reads need no file lock and use one database snapshot.
|
||||
|
||||
## Quality and temporary files
|
||||
|
||||
Pending cross-project Requests are Markdown files in `.ai-engineering/requests/`.
|
||||
Only `request create` bypasses the server and SQL, using independent UUIDs and atomic
|
||||
file publication. Treatment uses the normal server command path. Incorporation
|
||||
records original text and provenance in an ordinary discussion NOTE with a stable
|
||||
`request:REQ-...` thread; it adds no storage table or Work field. SQL commit precedes
|
||||
cleanup; a deterministic claimed filename supports recovery after a crash. Repeated
|
||||
incorporation reuses the existing note and rejects changed input or another Work.
|
||||
See [Requests](requests.md).
|
||||
|
||||
QualityGates stores required project definitions and cumulative Work additions.
|
||||
Observed results bind procedures, actual invocation, inputs, Work scope/guidance,
|
||||
DEC revisions, outcome and a short summary. Missing, failed or stale gates block
|
||||
|
||||
@@ -10,7 +10,10 @@ distribution default; the same entry point supports a JVM for development.
|
||||
drains admitted operations and is successful when already stopped. Normal commands
|
||||
can start the server again. Idle servers stop after 30 minutes with no active jobs;
|
||||
the timeout is configurable. Help, version, initialization and bootstrap guidance
|
||||
do not need a server. `aie status` retains its existing project-status meaning.
|
||||
do not need a server. `request create` also runs directly in the client and writes
|
||||
only a textual file to the destination inbox. `request list/show/incorporate` use
|
||||
the server for explicit treatment; see [Requests](requests.md).
|
||||
`aie status` retains its existing project-status meaning.
|
||||
|
||||
The canonical project path owns an exclusive OS lock and a loopback-only ephemeral
|
||||
port. A private descriptor under `.ai-engineering/.local/server/` contains the
|
||||
|
||||
+11
-1
@@ -3,7 +3,9 @@
|
||||
AIE is a local framework per project. `.ai-engineering/aie.db` owns operational
|
||||
memory: Works, investigation, decisions, Plans, execution facts and gate results.
|
||||
Small YAML/JSON and README/AGENTS files bootstrap discovery and configuration.
|
||||
There is no database server or background process. Git and source repositories are
|
||||
There is no separately managed database service; the CLI starts and reuses a local
|
||||
project server. Pending cross-project Requests are text files outside SQL, and their
|
||||
creation works with the server stopped. Git and source repositories are
|
||||
optional; synchronization, distributed IDs, Git LFS and Work/DEC export are outside
|
||||
this version.
|
||||
|
||||
@@ -25,6 +27,14 @@ new identities and owned references together. Migration preserves reserved gaps.
|
||||
|
||||
## Investigation and implementation
|
||||
|
||||
`request create TITLE --project DEST --author NAME --text TEXT` records a Request
|
||||
directly in the local destination's `.ai-engineering/requests/` without SQL or a
|
||||
server. Use `--text-file PATH` for multiline source text and optional
|
||||
`--source-work WRK-ID` for provenance. `request list/show/incorporate` use the server
|
||||
for explicit treatment with the human and current AI. Incorporation preserves the
|
||||
full original in Work context before removing the file; retries are idempotent.
|
||||
Attachments are deferred. See [Requests](requests.md) for commands and recovery.
|
||||
|
||||
Discussion/investigation and implementation remain separate cycles connected by
|
||||
DEC and Plan. Work stores scope, criteria and useful refinement; topics, surveys,
|
||||
answer supersession and explicit conclusions preserve continuity. OODA is adaptive:
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
# Requests between local projects
|
||||
|
||||
A Request records a textual demand from one local AIE project for another. Capture
|
||||
works with both servers stopped. It writes one Markdown UTF-8 file to the destination's
|
||||
`.ai-engineering/requests/`, without opening SQL, starting a server or looking for
|
||||
similar requests. An existing project configuration and write access are required.
|
||||
|
||||
## Capture
|
||||
|
||||
From the source project (or one of its subdirectories):
|
||||
|
||||
```sh
|
||||
aie request create "Expose the new parser API" \
|
||||
--project /path/to/destination --author source-agent \
|
||||
--source-work WRK-000F --text "The source project needs the parser diagnostics."
|
||||
```
|
||||
|
||||
`--project` is the required, explicit destination, not the source. It also accepts
|
||||
the destination's `.ai-engineering` directory. The source project is discovered
|
||||
from the caller's current directory. `--source-project /path/to/source` overrides
|
||||
that discovery; `--source-work` is optional and records a reference without querying
|
||||
the source's memory. Specify the actual human or agent with `--author`.
|
||||
|
||||
Use exactly one of `--text TEXT` or `--text-file PATH`. Input file paths are relative
|
||||
to the caller's current directory. The body preserves Unicode, indentation, blank
|
||||
lines and trailing newlines. Text must be nonblank; the complete stored document is
|
||||
limited to 1 MiB. Attachments are deferred.
|
||||
|
||||
Creation returns the Request and its absolute file path. `--format json` provides
|
||||
structured output. Files use `REQ-<UUID>.md`, with YAML front matter for schema and
|
||||
document versions, ID, title, source project, author, creation date and optional
|
||||
source Work. The body contains the original text. There is no shared counter.
|
||||
Publication makes a complete file visible atomically and cannot overwrite another
|
||||
producer's Request. SQL/bootstrap operational records are unchanged.
|
||||
|
||||
## Discuss and incorporate
|
||||
|
||||
At the destination, or with its path supplied through `--project`:
|
||||
|
||||
```sh
|
||||
aie request list
|
||||
aie request show REQ-00000000-0000-0000-0000-000000000001
|
||||
```
|
||||
|
||||
These commands use the destination server, starting it through the normal client
|
||||
flow if needed. The human and current AI discuss and group the texts in their
|
||||
ordinary conversation. Nothing analyzes or groups them automatically.
|
||||
|
||||
Choose an existing Work or create one using the normal Work commands, with the
|
||||
human's discussion mode and the usual decision authority. Then incorporate each
|
||||
selected Request explicitly:
|
||||
|
||||
```sh
|
||||
aie request incorporate REQ-00000000-0000-0000-0000-000000000001 \
|
||||
--work WRK-0001 --by destination-agent
|
||||
aie work context WRK-0001
|
||||
```
|
||||
|
||||
The original text and provenance become a NOTE in the Work's discussion history,
|
||||
under the thread `request:REQ-...`. Provenance includes the title, origin, original
|
||||
author/date, optional source Work and SHA-256 of the captured document. The note's
|
||||
author identifies the handler supplied through `--by`. A later synthesis may
|
||||
complement this note. The full original remains available in Work context after
|
||||
the Request file is removed; no second collection of treated files is retained.
|
||||
|
||||
Multiple Requests can be incorporated into the same Work. A Request already
|
||||
incorporated into another Work is a conflict. Incorporation does not transfer
|
||||
source approvals or authorize implementation.
|
||||
|
||||
## Failure and retry
|
||||
|
||||
The Work context commits before file deletion. On SQLite, the note and Work
|
||||
reference share a transaction; an enclosing rollback leaves the input untouched.
|
||||
If persistence fails, the Request remains available. After persistence, cleanup
|
||||
claims the file as `.REQ-<UUID>.consuming.md` before checking and removing it. A
|
||||
crash leaves this deterministic file discoverable by `request list` and `show`.
|
||||
|
||||
Repeat `request incorporate` with the same Request ID and Work after interrupted
|
||||
cleanup. The recorded thread, text and document hash identify the existing context;
|
||||
the operation finishes cleanup without adding a second note. Repeating after
|
||||
successful deletion also returns the previous incorporation with `reused: true`.
|
||||
Changed input or a different destination Work is reported as a conflict, retaining
|
||||
the remaining file for review. Both a normal file and a recovery file for one ID
|
||||
require explicit inspection; neither is silently overwritten. Reads do not remove
|
||||
files or perform recovery.
|
||||
|
||||
Pending Requests remain filesystem inputs rather than SQL records. Incorporation
|
||||
uses ordinary Work discussion storage, including SQL on SQLite projects, without
|
||||
adding a Request table or changing the database schema. The supported legacy
|
||||
backend retains its normal per-file persistence limits.
|
||||
|
||||
## Native verification
|
||||
|
||||
After building the candidate with `./gradlew nativePackage`, run:
|
||||
|
||||
```sh
|
||||
python3 scripts/native-requests-smoke.py --binary build/native/package/ai-engineering
|
||||
```
|
||||
|
||||
This creates disposable source/destination projects, checks offline capture leaves
|
||||
the database and server state untouched, incorporates two Requests through the
|
||||
native server, verifies original context and retry behavior, and stops its servers.
|
||||
The full package verifier also runs this scenario.
|
||||
Reference in New Issue
Block a user