feat(ariadne): add graph core crate
This commit is contained in:
11
AGENTS.md
11
AGENTS.md
@@ -96,5 +96,16 @@
|
||||
- In this monorepo, "dotfiles" refers to the dotfiles/NixOS configuration under `src/dotfiles/` and `configs/nixos/`.
|
||||
- The flake does not currently define `formatter.x86_64-linux`.
|
||||
Do not use `nix fmt` as a validation command until a formatter is added.
|
||||
- When creating a pull request from a worktree-specific development branch, create a dedicated pull-request branch
|
||||
separate from the branch that names or anchors the worktree.
|
||||
Do not open pull requests directly from the worktree branch.
|
||||
- Ariadne separates Rust library code and binary entry-point code under `src/ariadne/core/` and
|
||||
`src/ariadne/bin/`.
|
||||
Do not add a Cargo-default nested `src/ariadne/src/` source directory.
|
||||
- Use `bazel build` for non-test targets when no Bazel test target is part of the validation set.
|
||||
`bazel test` exits non-zero when it finds no test targets.
|
||||
- In Bazel `BUILD` files, depend on vendored Rust crates through the public aliases under
|
||||
`//third_party/crates`, for example `//third_party/crates:serde`.
|
||||
Use crate universe only to vendor crates, not as a dependency macro API for first-party targets.
|
||||
- Ariadne extraction must preserve the game-root season prefix for archived source.
|
||||
Different game installs can contain compiled scripts with the same internal path.
|
||||
|
||||
7
Cargo.lock
generated
7
Cargo.lock
generated
@@ -10,6 +10,13 @@ dependencies = [
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ariadne-bin"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ariadne",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.18"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"src/ariadne",
|
||||
"src/ariadne/bin",
|
||||
"src/ariadne/core",
|
||||
"src/machoke",
|
||||
]
|
||||
resolver = "3"
|
||||
|
||||
@@ -1,18 +1,3 @@
|
||||
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library")
|
||||
|
||||
rust_library(
|
||||
name = "ariadne_lib",
|
||||
crate_name = "ariadne",
|
||||
srcs = ["src/lib.rs"],
|
||||
)
|
||||
|
||||
rust_binary(
|
||||
name = "ariadne",
|
||||
crate_name = "ariadne_cli",
|
||||
srcs = ["src/main.rs"],
|
||||
deps = [":ariadne_lib"],
|
||||
)
|
||||
|
||||
sh_binary(
|
||||
name = "extract_and_decompile",
|
||||
srcs = ["extract-and-decompile.sh"],
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Ariadne
|
||||
|
||||
Ariadne prepares Ren'Py game source for later analysis.
|
||||
|
||||
## Bazel shape
|
||||
|
||||
Keep project-owned source under `src/ariadne/`. Keep game-derived files local and ignored under
|
||||
`src/ariadne/output/`.
|
||||
|
||||
The first target is a shell entry point:
|
||||
|
||||
```sh
|
||||
bazel run //src/ariadne:extract_and_decompile -- \
|
||||
--game-root /path/to/game-install
|
||||
```
|
||||
|
||||
The script defaults to `<workspace>/src/ariadne/output`.
|
||||
This path stays stable when you run the command from inside `src/ariadne`.
|
||||
Use the game installation directory as the game root.
|
||||
One run processes all installed season directories.
|
||||
Extracted archive source keeps the archive path relative to the game root, so files with the same
|
||||
internal path from different season installs do not overwrite each other.
|
||||
If `rpycdec` is not available, the script uses `extract-tools.nix` to enter a Nix shell.
|
||||
|
||||
Keep the script as a thin orchestration layer.
|
||||
Bazel owns stable inputs and wrappers.
|
||||
Keep large game files and recovered output outside the build graph.
|
||||
9
src/ariadne/bin/BUILD
Normal file
9
src/ariadne/bin/BUILD
Normal file
@@ -0,0 +1,9 @@
|
||||
load("@rules_rust//rust:defs.bzl", "rust_binary")
|
||||
|
||||
rust_binary(
|
||||
name = "ariadne",
|
||||
crate_name = "ariadne_cli",
|
||||
visibility = ["//src/ariadne:__pkg__"],
|
||||
srcs = ["main.rs"],
|
||||
deps = ["//src/ariadne/core:ariadne_lib"],
|
||||
)
|
||||
11
src/ariadne/bin/Cargo.toml
Normal file
11
src/ariadne/bin/Cargo.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "ariadne-bin"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[[bin]]
|
||||
name = "ariadne"
|
||||
path = "main.rs"
|
||||
|
||||
[dependencies]
|
||||
ariadne = { path = "../core" }
|
||||
16
src/ariadne/core/BUILD
Normal file
16
src/ariadne/core/BUILD
Normal file
@@ -0,0 +1,16 @@
|
||||
load("@rules_rust//rust:defs.bzl", "rust_library")
|
||||
|
||||
rust_library(
|
||||
name = "ariadne_lib",
|
||||
crate_name = "ariadne",
|
||||
crate_root = "lib.rs",
|
||||
visibility = ["//src/ariadne:__subpackages__"],
|
||||
srcs = [
|
||||
"graph.rs",
|
||||
"lib.rs",
|
||||
],
|
||||
deps = [
|
||||
"//third_party/crates:serde",
|
||||
"//third_party/crates:serde_json",
|
||||
],
|
||||
)
|
||||
@@ -3,6 +3,9 @@ name = "ariadne"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
4
src/ariadne/core/graph.rs
Normal file
4
src/ariadne/core/graph.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
//! In-memory graph model used by Ariadne pipeline stages.
|
||||
|
||||
#[derive(Clone, Debug, Default, Eq, PartialEq)]
|
||||
pub struct Graph;
|
||||
@@ -1,3 +1,5 @@
|
||||
pub mod graph;
|
||||
|
||||
pub fn run() {
|
||||
println!("Ariadne");
|
||||
}
|
||||
Reference in New Issue
Block a user