Skip to content

Commit 792c7e2

Browse files
Merge pull request #18 from SolidLabResearch/codex/repo-hardening
repo: harden runtime and simplify repository layout
2 parents fe22349 + fb15d35 commit 792c7e2

30 files changed

Lines changed: 117 additions & 3263 deletions

.github/workflows/fast-pr.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
- name: Run Clippy
4949
run: cargo clippy --all-targets --all-features -- -D warnings
5050

51-
test:
52-
name: Test Suite
51+
smoke:
52+
name: Integration Smoke
5353
runs-on: ubuntu-latest
5454
steps:
5555
- name: Checkout code
@@ -61,8 +61,14 @@ jobs:
6161
- name: Cache Rust build artifacts
6262
uses: Swatinem/rust-cache@v2
6363

64-
- name: Run tests
65-
run: cargo test --all-features --verbose
64+
- name: Run Janus API integration smoke test
65+
run: cargo test --test janus_api_integration_test --all-features
6666

67-
- name: Run doc tests
68-
run: cargo test --doc --all-features --verbose
67+
- name: Run HTTP server integration smoke test
68+
run: cargo test --test http_server_integration_test --all-features
69+
70+
- name: Run stream bus CLI smoke test
71+
run: cargo test --test stream_bus_cli_test --all-features
72+
73+
- name: Build HTTP client example
74+
run: cargo build --example http_client_example --all-features

GETTING_STARTED.md

Lines changed: 49 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,86 @@
11
# Getting Started with Janus
22

3-
This guide reflects the current state of the repository.
4-
5-
Janus is primarily a backend Rust project. The most useful entry points today are:
6-
7-
- `http_server` for the HTTP/WebSocket API
8-
- `stream_bus_cli` for replaying RDF files into storage and MQTT
9-
- the Rust test suite for validating the engine locally
3+
Janus is a Rust engine for querying historical and live RDF data through one
4+
Janus-QL model and one HTTP/WebSocket API.
105

116
## Prerequisites
127

13-
- Rust stable
14-
- Cargo
15-
- Git
16-
- Docker, if you want to run the local MQTT broker
17-
18-
## Clone and Build
19-
20-
```bash
21-
git clone https://github.com/SolidLabResearch/janus.git
22-
cd janus
23-
24-
cargo build
25-
```
8+
- Rust stable with Cargo
9+
- Docker and Docker Compose if you want the MQTT-backed replay flow
2610

27-
## Run the Backend
11+
## Fastest Working Path
2812

29-
### Option 1: Start the HTTP API
13+
### 1. Build and test
3014

3115
```bash
32-
cargo run --bin http_server
16+
make build
17+
make test
3318
```
3419

35-
The server listens on `http://127.0.0.1:8080` by default.
36-
37-
### Option 2: Inspect the replay CLI
20+
### 2. Start the HTTP server
3821

3922
```bash
40-
cargo run --bin stream_bus_cli -- --help
23+
cargo run --bin http_server -- --host 127.0.0.1 --port 8080 --storage-dir ./data/storage
4124
```
4225

43-
Typical usage:
26+
Verify it is up:
4427

4528
```bash
46-
cargo run --bin stream_bus_cli -- \
47-
--input data/sensors.nq \
48-
--broker none \
49-
--rate 0
29+
curl http://127.0.0.1:8080/health
5030
```
5131

52-
## Run Tests
53-
54-
```bash
55-
cargo test --all-features
56-
```
32+
### 3. Exercise the API
5733

58-
## Run Lint Checks
34+
The quickest end-to-end client is the example binary:
5935

6036
```bash
61-
cargo clippy --all-targets --all-features -- -D warnings
37+
cargo run --example http_client_example
6238
```
6339

64-
## Quick HTTP Flow
40+
That example covers query registration, start, stop, replay control, and
41+
WebSocket result consumption.
6542

66-
1. Start the server:
43+
## Optional Local Demo UI
6744

68-
```bash
69-
cargo run --bin http_server
70-
```
45+
This repository keeps a small static demo at
46+
`examples/demo_dashboard.html` for manual browser testing.
7147

72-
2. Register a query:
48+
The maintained Svelte dashboard lives in the separate
49+
`SolidLabResearch/janus-dashboard` repository.
7350

74-
```bash
75-
curl -X POST http://localhost:8080/api/queries \
76-
-H "Content-Type: application/json" \
77-
-d '{
78-
"query_id": "demo_query",
79-
"janusql": "PREFIX ex: <http://example.org/> SELECT ?s ?p ?o FROM NAMED WINDOW ex:w ON STREAM ex:sensorStream [START 0 END 9999999999999] WHERE { WINDOW ex:w { ?s ?p ?o . } }"
80-
}'
81-
```
82-
83-
3. Start the query:
84-
85-
```bash
86-
curl -X POST http://localhost:8080/api/queries/demo_query/start
87-
```
51+
## Main Binaries
8852

89-
4. Subscribe to results:
53+
- `http_server`: REST and WebSocket API for query lifecycle and replay control
54+
- `stream_bus_cli`: replay and ingestion CLI for RDF event files
9055

91-
```text
92-
ws://localhost:8080/api/queries/demo_query/results
93-
```
94-
95-
5. Stop the query when done:
56+
## Common Commands
9657

9758
```bash
98-
curl -X POST http://localhost:8080/api/queries/demo_query/stop
99-
```
100-
101-
## Project Layout
102-
103-
```text
104-
janus/
105-
├── src/
106-
│ ├── api/ # Janus API coordination layer
107-
│ ├── core/ # RDF event types and encoding
108-
│ ├── execution/ # Historical execution and result conversion
109-
│ ├── http/ # HTTP and WebSocket server
110-
│ ├── parsing/ # JanusQL parser
111-
│ ├── querying/ # SPARQL execution adapters
112-
│ ├── storage/ # Segmented storage and indexing
113-
│ ├── stream/ # Live stream processing
114-
│ └── stream_bus/ # Replay and broker integration
115-
├── tests/ # Integration and module tests
116-
├── examples/ # Example clients and benchmarks
117-
├── docs/ # Documentation
118-
└── janus-dashboard/ # Lightweight local demo dashboard
59+
make build
60+
make release
61+
make test
62+
make fmt
63+
make fmt-check
64+
make lint
65+
make check
66+
make ci-check
11967
```
12068

121-
## Dashboard Boundary
122-
123-
This repository includes a small demo dashboard under `janus-dashboard/`, but the maintained dashboard lives separately:
124-
125-
- `https://github.com/SolidLabResearch/janus-dashboard`
69+
## Repository Layout
12670

127-
If you are working on frontend product features, use the separate dashboard repository.
71+
- `src/api`: query lifecycle orchestration
72+
- `src/http`: REST and WebSocket server
73+
- `src/parsing`: Janus-QL parsing
74+
- `src/execution`: historical execution
75+
- `src/stream`: live stream processing
76+
- `src/storage`: segmented RDF storage
77+
- `src/bin`: executable binaries
78+
- `examples`: runnable examples and a minimal static demo
79+
- `tests`: integration coverage
80+
- `docs`: current docs plus older design notes
12881

129-
## Recommended Next Reads
82+
## Where to Read Next
13083

131-
- [START_HERE.md](./START_HERE.md)
132-
- [docs/README_HTTP_API.md](./docs/README_HTTP_API.md)
133-
- [docs/STREAM_BUS_CLI.md](./docs/STREAM_BUS_CLI.md)
134-
- [docs/README.md](./docs/README.md)
84+
- `README.md`
85+
- `START_HERE.md`
86+
- `docs/DOCUMENTATION_INDEX.md`

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ This example demonstrates:
124124
- replay control
125125
- WebSocket result consumption
126126

127+
### Frontend Boundary
128+
129+
The maintained web dashboard lives in the separate
130+
`SolidLabResearch/janus-dashboard` repository.
131+
132+
This repository keeps a small static demo at
133+
[`examples/demo_dashboard.html`](./examples/demo_dashboard.html) for manual API
134+
testing, but frontend development should happen in the dedicated dashboard repo.
135+
127136
## Development
128137

129138
### Common Commands
@@ -145,6 +154,8 @@ make ci-check # local CI script
145154
The repository includes runnable examples under [`examples/`](./examples), including:
146155

147156
- [`examples/http_client_example.rs`](./examples/http_client_example.rs)
157+
- [`examples/comparator_demo.rs`](./examples/comparator_demo.rs)
158+
- [`examples/demo_dashboard.html`](./examples/demo_dashboard.html) for a minimal local demo
148159

149160
## Documentation
150161

START_HERE.md

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,32 @@
1-
# Janus Backend - Start Here
2-
3-
Use this file if you want the fastest path to a working local backend.
1+
# Janus Start Here
42

53
## Quick Start
64

7-
### 1. Start the MQTT broker
8-
95
```bash
106
docker-compose up -d mosquitto
7+
cargo run --bin http_server -- --host 127.0.0.1 --port 8080 --storage-dir ./data/storage
8+
curl http://127.0.0.1:8080/health
119
```
1210

13-
### 2. Start the HTTP server
14-
15-
```bash
16-
cargo run --bin http_server
17-
```
18-
19-
### 3. Check health
20-
21-
```bash
22-
curl http://localhost:8080/health
23-
```
24-
25-
Expected response:
26-
27-
```json
28-
{"message":"Janus HTTP API is running"}
29-
```
30-
31-
## Optional: Open the local demo dashboard
32-
33-
This repository contains a small demo dashboard:
11+
In another terminal, run:
3412

3513
```bash
36-
open examples/demo_dashboard.html
14+
cargo run --example http_client_example
3715
```
3816

39-
For the maintained frontend, use the separate repository:
40-
41-
- `https://github.com/SolidLabResearch/janus-dashboard`
42-
43-
## Most Useful Docs
17+
## What To Use
4418

45-
- [GETTING_STARTED.md](./GETTING_STARTED.md)
46-
- [docs/README_HTTP_API.md](./docs/README_HTTP_API.md)
47-
- [docs/QUICKSTART_HTTP_API.md](./docs/QUICKSTART_HTTP_API.md)
48-
- [docs/README.md](./docs/README.md)
19+
- `http_server` is the main backend entry point
20+
- `stream_bus_cli` is the ingestion and replay CLI
21+
- `examples/demo_dashboard.html` is a minimal manual demo
22+
- the maintained Svelte dashboard lives in the separate `janus-dashboard` repository
4923

50-
## Notes
24+
## Current Docs
5125

52-
- The backend is the primary concern of this repository.
53-
- `http_server` is the main user-facing executable.
54-
- `stream_bus_cli` is the replay/ingestion CLI.
26+
- `README.md`
27+
- `GETTING_STARTED.md`
28+
- `docs/DOCUMENTATION_INDEX.md`
29+
- `docs/HTTP_API_CURRENT.md`
30+
- `docs/README_HTTP_API.md`
31+
- `docs/QUICKSTART_HTTP_API.md`
32+
- `docs/QUICK_REFERENCE.md`

docs/DOCUMENTATION_INDEX.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This is the shortest path to understanding the current Janus implementation.
1212
6. [BASELINES.md](./BASELINES.md)
1313
7. [HTTP_API_CURRENT.md](./HTTP_API_CURRENT.md)
1414
8. [ANOMALY_DETECTION.md](./ANOMALY_DETECTION.md)
15+
9. [QUICK_REFERENCE.md](./QUICK_REFERENCE.md)
1516

1617
## What Each File Covers
1718

@@ -38,29 +39,33 @@ This is the shortest path to understanding the current Janus implementation.
3839
- current REST endpoints
3940
- WebSocket result flow
4041
- request and response shapes
41-
- `baseline_mode` registration fallback
42+
- persisted query lifecycle status
4243

4344
- [ANOMALY_DETECTION.md](./ANOMALY_DETECTION.md)
4445
- when extension functions are enough
4546
- when baseline state helps
4647
- recommended query patterns
4748

49+
- [QUICK_REFERENCE.md](./QUICK_REFERENCE.md)
50+
- common local commands
51+
- query lifecycle endpoints
52+
- replay endpoints
53+
- smoke-test flow
54+
4855
## Additional Current Guides
4956

5057
- [STREAM_BUS_CLI.md](./STREAM_BUS_CLI.md)
5158
- [README_HTTP_API.md](./README_HTTP_API.md)
5259
- [QUICKSTART_HTTP_API.md](./QUICKSTART_HTTP_API.md)
53-
- [QUICK_REFERENCE.md](./QUICK_REFERENCE.md)
5460

5561
## Legacy Material
5662

5763
The following files remain useful as background, but they are not the main entrypoint for the current code:
5864

5965
- [ARCHITECTURE.md](./ARCHITECTURE.md)
6066
- [EXECUTION_ARCHITECTURE.md](./EXECUTION_ARCHITECTURE.md)
61-
- [HTTP_API.md](./HTTP_API.md)
62-
- [MVP_TODO.md](./MVP_TODO.md)
6367
- [MVP_ARCHITECTURE.md](./MVP_ARCHITECTURE.md)
68+
- [MVP_TODO.md](./MVP_TODO.md)
6469
- [RSP_INTEGRATION_COMPLETE.md](./RSP_INTEGRATION_COMPLETE.md)
6570
- [SPARQL_BINDINGS_UPGRADE.md](./SPARQL_BINDINGS_UPGRADE.md)
6671

0 commit comments

Comments
 (0)