Commit graph

39 commits

Author SHA1 Message Date
6e07bff08a ANW-43 CLI: add a query subcommand writing the /query JSON offline
The README claims the query engine is available offline, but only the
merge half was: no subcommand produced the path / frontmatter /
last_modified / etag / size projection that GET /query returns.

`anwesen query` takes the same --vault and --query flags as merge and
writes that document to stdout, compact, one line. src/merge.rs becomes
src/oneshot.rs and holds both: one parse-and-load path, so the two
subcommands cannot drift in grammar or in how strictly they read a
vault. cli.rs shares one VaultQueryArgs between them for the same
reason. rfc3339_z moves from http.rs to query.rs, next to the projection
whose timestamp dialect it is.

Assumed a trailing newline on stdout is wanted here even though merge
writes none: the JSON body is one line for jq and shell pipelines, and
the newline terminates it rather than joining the document. Flag if
wrong.

The hurl harness now compares `anwesen query` against GET /query on the
fixture vault for four queries before running the suite, so a drift
between the two surfaces fails CI.
2026-07-31 15:59:18 +03:00
30bca24b5c ANW-45 Serve: exit nonzero when the supervisor tree fails to start
Hydra's Application::run logs a start failure and returns normally, so
serve exited 0 after the tree never came up. systemd read that as a clean
start and Restart=on-failure never retried; anwesen was unreachable on ap
for 12 hours with NRestarts=0.

Anwesen carries a started flag that start() sets once the supervisor is
up, and main exits 1 when it is still false after run() returns.

Assumed the flag is the only seam available: run() consumes self and
returns (), so the Err is not observable at the call site. Flag if a newer
hydra exposes the result.
2026-07-29 22:22:24 +03:00
d6261bd5f9 ANW-44 Release: bump version to 0.3.0
Some checks failed
release / aarch64-linux (push) Has been cancelled
release / aarch64-macos (push) Has been cancelled
release / x86_64-linux (push) Has been cancelled
release / publish (push) Has been cancelled
2026-07-27 00:21:53 +03:00
dc113b8249 ANW-42 Telemetry: take export config from OTEL_ environment variables only
Delete the uptrace DSN parser and the {endpoint}/v1/* concatenation that
produced the dead export, and build the OTLP exporters with no endpoint,
headers, or protocol so the SDK reads OTEL_EXPORTER_OTLP_* itself.

The SDK concatenates as naively as we did: measured against a local sink,
a ?query base sends POST /?query/v1/metrics and a #fragment base sends
POST /. So one check stays -- a query or fragment on
OTEL_EXPORTER_OTLP_ENDPOINT fails at startup. Per-signal variables are
used verbatim and need none.

A protocol variable is the second startup check. The exporter picks its
transport at build time and this binary ships OTLP/HTTP alone, so
OTEL_EXPORTER_OTLP_PROTOCOL=grpc kept exporting over HTTP with nothing in
the log -- the same silence this change removes.

service.name stays a default rather than policy: an attribute set on the
resource builder wins over the SDK detectors that read OTEL_SERVICE_NAME
and OTEL_RESOURCE_ATTRIBUTES, so anwesen supplies its own only for keys
the environment leaves alone.

Telemetry-off is our own check on the endpoint variables: with none set
the exporter would still build and aim at the SDK default localhost:4318.

--uptrace-dsn, --otlp-endpoint, and --otlp-header stay parsed but hidden,
so a deployment upgrading with them set fails naming the OTEL_
replacement instead of going quiet.

Assumed hidden clap stubs are the right migration shape; clap rejecting
the flags as unknown would say nothing about the replacement. Flag if a
plain unknown-argument error is wanted instead.

Assumed rejecting http/json alongside grpc is right: neither has a
transport in this build. Flag if a build with both features is wanted
instead.
2026-07-27 00:06:36 +03:00
8894ea0c7b ANW-41 Docs: fix four broken rustdoc intra-doc links
cargo doc --no-deps is warning-free. No behaviour change.
2026-07-24 23:41:37 +03:00
134b1d44b3 ANW-39 Release: bump version to 0.2.0
Some checks failed
release / aarch64-linux (push) Has been cancelled
release / aarch64-macos (push) Has been cancelled
release / x86_64-linux (push) Has been cancelled
release / publish (push) Has been cancelled
2026-07-24 21:42:18 +03:00
bbb052fdc7 ANW-40 Watcher: emit both deletes for a vanished .md path
A directory can be named *.md too, and a vanished path cannot be probed,
so the suffix test alone stranded its notes in the index. Emit the note
delete and the prefix delete together; the two key sets are disjoint.
2026-07-24 21:32:51 +03:00
275c6ecfa0 ANW-36 Watcher: drop index entries when note files are deleted 2026-07-24 21:19:13 +03:00
23ce90e103 ANW-37 Telemetry: request metrics + selective traces over OTLP
Optional OTLP export of request-level metrics (request and response-byte
counters keyed by route/status/conditional-GET, a duration histogram out
to 600s) plus server spans for slow or 5xx requests, nested under the
incoming W3C trace context. Off unless an OTLP endpoint or uptrace DSN is
configured; a config-less server is byte-for-byte unchanged.
2026-07-24 21:08:07 +03:00
b271d57cbb ANW-1 Release: bump version to 0.1.0 for the first official release
Some checks failed
release / aarch64-linux (push) Has been cancelled
release / aarch64-macos (push) Has been cancelled
release / x86_64-linux (push) Has been cancelled
release / publish (push) Has been cancelled
2026-06-24 19:33:23 +03:00
345de590a5 ANW-1 Release: bump version to 0.0.1 for the first official release
Some checks failed
release / aarch64-linux (push) Has been cancelled
release / aarch64-macos (push) Has been cancelled
release / x86_64-linux (push) Has been cancelled
release / publish (push) Has been cancelled
2026-06-24 19:26:43 +03:00
b981522c7d ANW-33 CI: drop redundant on-demand Forgejo Linux build
The IT-86 release pipeline (release.yml) now builds both Linux targets
on GitHub and mirrors the binaries back to Forgejo, proven end-to-end by
the v0.0.0-ci.1 run (ANW-31, Verified). The on-demand Forgejo build from
ANW-30 was the fallback Linux CI until then; it is now redundant.
2026-06-24 18:52:53 +03:00
fc5edbda16 ANW-34 CI: gzip + strip release binaries
ap keeps every release and the raw, unstripped binaries are the bulk of
that storage. Strip symbols via the release profile and gzip -9 each
asset before upload (~2.7x smaller); the publish job and Forgejo
mirror-back pass the .gz assets through unchanged.

Assumed .gz per binary over .tar.gz -- the assets are single files, so a
tarball only adds a directory layer. Flag if a bundle (LICENSE/README) is
wanted. E2E needs a release run; piggyback on the next real tag.
2026-06-24 18:41:07 +03:00
863f418538 ANW-32 CI: switch release.yml to the IT-86 Forgejo->GitHub pipeline
Tag-triggered (v* on the Forgejo mirror) instead of a hand-made GitHub
release. Adds an aarch64-linux leg; a single publish job creates the GitHub
release and mirrors every binary back onto the matching Forgejo release via
FORGEJO_RELEASE_TOKEN. Keeps the hurl HTTP contract harness on x86_64-linux.

Assumed v* tags are the release trigger and the contract tests run once on the
deploy target (x86_64-linux); flag if either is wrong.
2026-06-24 18:02:40 +03:00
04a6165867 ANW-30 CI: cross-compile arm64 on the host runner, publish via RELEASE_TOKEN
Collapse the matrix to one linear job on the amd64 :host runner: test
once, then build x86_64 natively and aarch64 by cross-compilation, then
publish both to a Forgejo release. Authenticate the upload with a real
write token (RELEASE_TOKEN, the carvers-ci bot) -- Forgejo's auto
GITHUB_TOKEN cannot upload release attachments. prerelease is a string
input, not boolean, so its value survives an API workflow_dispatch.
2026-06-24 10:48:21 +03:00
09b9b99791 ANW-30 CI: Forgejo build workflow -- on-demand build + release for amd64/arm64
Forgejo-side counterpart to the GitHub release.yml (ANW-29). Driven by
workflow_dispatch (UI or API) rather than a release-published event, so a
build can be triggered for a test. Builds the release binary natively per
target, runs the test suite first, and publishes the assets to a Forgejo
release via actions/forgejo-release.

Assumed runner labels linux-amd64 / macos-arm64 must match the forge's
act_runner registration; arm64 needs a native Apple Silicon runner. Flagged
to aav -- correct if the topology differs.
2026-06-23 23:25:21 +03:00
7284edc76a
ANW-28 docs: add agentic engeneering note the README
Signed-off-by: Alexey Aristov <aav@acm.org>
2026-06-14 22:17:47 +03:00
562f3b20a7 ANW-28 docs: README and LICENSE for the public mirror
Replace the placeholder README with the full public-facing README, and
switch licensing to BSD 3-Clause per aav's decision on ANW-28: add a single
LICENSE file, drop the dual LICENSE-MIT / LICENSE-APACHE, and update the
Cargo.toml license field to match. README/LICENSE content authored by kaa,
landed verbatim.

Assumed: dropping the old MIT/Apache files and updating Cargo.toml
license = BSD-3-Clause is the consistent completion of aav's BSD decision
(v0.0.0, nothing released relied on the old grant); flag if the dual
license was meant to stay.
2026-06-14 21:52:29 +03:00
3b3e550860 ANW-29 CI: GitHub Actions release workflow (build + test + upload)
On a published GitHub Release, for each target (amd64 Linux, arm macOS) run
the Rust test suite and the hurl HTTP contract tests, build the release
binary on a stable toolchain, and upload it as a target-named asset on the
triggering release. Trigger is release:published per ANW-29 -- aav creates
the release and tag in the UI; the workflow never creates them.
2026-06-14 21:35:50 +03:00
ed1759da59 ANW-27 CLI: anwesen merge -- one-shot local markdown-merge to stdout
Thin local front-end over ANW-26's merge engine (query::execute_merge):
walk the vault once (vault::scan, same as doctor), evaluate the --query
string, assemble the merged document, write it to stdout. No HTTP, no
watcher, no index. Byte-identical to the HTTP merge mode for the same
vault and query.
2026-06-14 21:24:19 +03:00
03cc12e640 ANW-26 HTTP /query markdown-merge mode
Accept: text/markdown on /query concatenates matched note bodies into one
markdown document, each fragment preceded by an HTML-comment source marker.
Adds __anw-order (frontmatter-key ordering, asc/desc, missing-key-last) and
__anw-kind (homogeneity guard, 400 on a mixed merge). Both evaluate over the
full matched set before __anw-limit truncates. Merge mode uses its own
body-cloning projection; the JSON path is unchanged (no body clone).
2026-06-14 18:35:20 +03:00
0c461be698 ANW-19 deployment: systemd unit and reverse-proxy example 2026-06-14 18:31:45 +03:00
44d6bb995e ANW-25 process_wrap axum middleware for request isolation 2026-05-14 19:33:41 +02:00
05013df061 ANW-24 http_server as a plain process with graceful shutdown 2026-05-14 19:28:51 +02:00
b4a33abd71 ANW-20 hurl HTTP contract-test harness 2026-05-14 19:11:00 +02:00
ec650e6c66 ANW-23 remove tantivy from v1; NoteStore is the only authoritative store 2026-05-14 18:58:39 +02:00
30c42131b7 ANW-9 doctor frontmatter type-drift detection 2026-05-14 18:47:44 +02:00
e7eea4b3aa ANW-18 doctor base checks + FrontmatterNotMapping variant 2026-05-14 18:29:49 +02:00
1e4d2a7b7c ANW-8 /health endpoint + ANW-15 local follow-ups 2026-05-14 16:31:13 +02:00
b045efd1f0 ANW-15 /query endpoint + restart-replay pin + UTC canonicalization 2026-05-14 16:17:26 +02:00
da2dfbbd6d ANW-14 GET /notes/<folder>/ directory listing 2026-05-14 16:03:45 +02:00
e1fe1dcb4e ANW-13 GET /notes/<path>: NoteStore + axum HttpServer wiring 2026-05-14 15:47:00 +02:00
095ea7fbf0 ANW-16 filesystem watcher: notify, debouncer, overflow recovery + batched commits 2026-05-14 15:34:17 +02:00
cd337202ee ANW-12 tantivy index: schema, upsert, rebuild on startup, scanner->writer wire 2026-05-14 15:06:41 +02:00
929e498f66 ANW-17 wire hydra supervisor tree with four permanent processes 2026-05-14 14:51:28 +02:00
49fc34f8d7 ANW-11 vault scanner: walk, parse frontmatter, compute ETag 2026-05-14 14:42:28 +02:00
36492c8058 ANW-10 address review: drop ANWESEN_LOG, validate --bind at parse 2026-05-14 14:35:44 +02:00
317667cce7 ANW-10 bootstrap anwesen crate and CLI skeleton 2026-05-14 14:28:11 +02:00
0c21e6c5ff init 2026-05-13 18:24:44 +02:00