@aaac/observability 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 foo-log-inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @aaac/observability
2
+
3
+ aaac-native, in-process observability recording for the AaaC toolchain.
4
+ Records agent / process / promotion events into a local SQLite store and emits
5
+ them to a generic OTEL backend. See `docs/observability-spec/` for the full design.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @aaac/observability
11
+ ```
12
+
13
+ Requires Node.js >= 22.5 (uses the built-in `node:sqlite`).
14
+
15
+ ## What it does
16
+
17
+ - **In-process recording**: `@aaac/runtime` emits agent-axis spans via
18
+ `observer.emit()`; external processes (git / Cursor hooks, CI) register events
19
+ via `registerExternalEvent()`.
20
+ - **Pipeline**: EventCollector → Normalizer → Correlator (span lifecycle pairing,
21
+ duration, traceId) → Enricher (TypeScript correlation completion) → SqliteSink
22
+ + OtelEmitter.
23
+ - **CanonicalEvent** internal model with cross-axis links; OTEL is the export
24
+ representation (Span / SpanLink).
25
+ - **Generic OTEL aggregation**: `OtelEmitter` batches CanonicalEvents to an
26
+ OTLP-compatible backend (fail-open — local SQLite always records).
27
+ - **Query (read path)**: `QueryAdapter` over the SQLite store — span / trace /
28
+ link traversal, independent of the write path.
29
+
30
+ ## Library usage
31
+
32
+ ```typescript
33
+ import { createPipeline, EventCollector } from "@aaac/observability";
34
+ ```
35
+
36
+ ## CLI: `aaac-observ`
37
+
38
+ A thin entrypoint for external event registration and querying (interface
39
+ defined via cli-contracts).
40
+
41
+ ```bash
42
+ aaac-observ record --event-type process.edit --lifecycle instant --attr edit.path=src/x.ts
43
+ aaac-observ query trace --trace-id <id>
44
+ ```
45
+
46
+ ## Documentation
47
+
48
+ - Event format and catalog: `docs/observability-spec/event-catalog.md`
49
+ - Architecture: `docs/observability-spec/architecture.md`
50
+ - 3-axis model: `docs/observability-spec/shift-left-guidline-v2.md`
51
+
52
+ ## License
53
+
54
+ MIT