Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ compiler/tooling crates (`wright-ir`, `wright-core`, `wright-driver`,
generated artifacts, and dependencies.
* Keep commits focused on one functional boundary and do not include unrelated
working-tree changes.
* Describe planning work by concrete capability, issue reference, or release
version (normative pre-1.0 roadmap: [#134](https://github.com/wrightkit/wright/issues/134));
internal phase-number labels are not the roadmap model for new issues, PRs,
or living docs.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ interoperability boundary.
| --- | --- | --- | --- | --- |
| **Vanilla Workshop** | Canonical target and interoperability layer | Native parser, localized catalog (`catalog.json`), validation, and deterministic emitter (`wright-workshop`). Supports rules, actions, values, events, enums, variables, subroutines, and custom-game-settings emission. | Supported (`en-US` baseline; data-driven localization extensible) | [`docs/workshop/support-matrix.md`](docs/workshop/support-matrix.md) |
| **OPY / OverPy** | Native compatible semantic frontend | Native Rust parser (`wright-opy`), preprocessor (`#!include`, `#!define`), macro expansion, declarations, expressions, enums, custom-game-settings (JSONC blocks), lowering to Wright HIR and Workshop IR. Pinned `[email protected]` acts strictly as an external compatibility oracle under clean-room isolation. | Supported (corpus-evidenced native compiler and tooling) | [`docs/opy/support-matrix.md`](docs/opy/support-matrix.md), [`docs/licensing.md`](docs/licensing.md) |
| **OSTW (Overwatch Script To Workshop)** | Compatible semantic frontend (M13 foundation) | Native Rust parser/CST (`wright-ostw`), project settings (`ds.toml`), import-closure resolution, and semantic lowering to Wright HIR for the protect-ban slice. Pinned OSTW `v3.4.0` serves strictly as an external compatibility oracle. | In progress (M13 native frontend & HIR lowering baseline) | [`docs/ostw/compatibility-baseline.md`](docs/ostw/compatibility-baseline.md), [`docs/architecture.md`](docs/architecture.md) |
| **OSTW (Overwatch Script To Workshop)** | Compatible semantic frontend (native OSTW frontend) | Native Rust parser/CST (`wright-ostw`), project settings (`ds.toml`), import-closure resolution, and semantic lowering to Wright HIR for the protect-ban slice. Pinned OSTW `v3.4.0` serves strictly as an external compatibility oracle. | In progress (native frontend & HIR lowering baseline) | [`docs/ostw/compatibility-baseline.md`](docs/ostw/compatibility-baseline.md), [`docs/architecture.md`](docs/architecture.md) |

### Conversion Matrix

Expand All @@ -69,7 +69,7 @@ long-term conversion directions are:

```text
OPY → Workshop (Supported: native wright-opy → HIR → WIR → wright-workshop)
OSTW → Workshop (In progress / M13: native wright-ostw → HIR → WIR → wright-workshop)
OSTW → Workshop (In progress: native wright-ostw → HIR → WIR → wright-workshop)
Workshop → OPY (Planned: decompilation / translation via canonical WIR)
Workshop → OSTW (Planned: translation via canonical WIR)
Workshop → Workshop (Supported: localized catalog parse → canonical WIR → deterministic emit)
Expand Down
4 changes: 2 additions & 2 deletions crates/wright-analyzer/src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
//! while-without-wait trigger is static but the impact (loop frequency) is an
//! indicator, and `For Global Variable` loops are never flagged.
//!
//! Every [`Finding`] also carries the [`EvidenceClass`] of its rule (M12,
//! #98): whether the finding is an exact structural fact, a static indicator,
//! Every [`Finding`] also carries the [`EvidenceClass`] of its rule (#98):
//! whether the finding is an exact structural fact, a static indicator,
//! a documented heuristic, or (reserved) runtime-validated.

use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion crates/wright-analyzer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Wright's semantic analysis and agent tooling layer.
//!
//! This crate builds on [`wright_ir`] to expose read-only semantic services
//! over compiled programs (ADR-0006, milestone M4):
//! over compiled programs (ADR-0006):
//!
//! * [`symbols`] — symbol tables, reference indices, and usage queries;
//! * [`cfg`] — control-flow graphs and timing-aware primitives;
Expand Down
6 changes: 3 additions & 3 deletions crates/wright-analyzer/src/registry.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Lint rule registry and configuration contract (M12, #97).
//! Lint rule registry and configuration contract (#97).
//!
//! This module defines the stable rule-identity and metadata types, the
//! [`LintRegistry`] that holds the first-party rule set, and [`LintConfig`]
Expand Down Expand Up @@ -204,13 +204,13 @@ struct RegistryEntry {
///
/// First-party rules are added by pushing a [`RegistryEntry`] in
/// [`Default::default`]. Third-party plugin loading is explicitly out of scope
/// for M12 (issue #97).
/// (issue #97).
pub struct LintRegistry {
entries: Vec<RegistryEntry>,
}

impl Default for LintRegistry {
/// Build the registry containing all five first-party M12 lint rules in
/// Build the registry containing all five first-party lint rules in
/// their canonical order: `min-wait-loop`, `duplicate-condition`,
/// `expensive-loop-check`, `repeated-value`, `while-without-wait`.
fn default() -> Self {
Expand Down
4 changes: 2 additions & 2 deletions crates/wright-analyzer/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub enum Request {
/// Every static-analysis finding.
GetFindings,
/// The registered lint rules and the effective lint configuration
/// (M12, #98).
/// (#98).
LintRules,
}

Expand Down Expand Up @@ -149,7 +149,7 @@ impl<'a> SemanticService<'a> {
/// `config` controls which rules run and at what severity; callers that
/// only need the default behavior should use [`SemanticService::with_origin`].
/// The retained `config` also drives `lintRules` responses, so rule
/// metadata and findings always reflect the same configuration (M12, #98).
/// metadata and findings always reflect the same configuration (#98).
pub fn with_origin_and_config(
program: &'a wir::Program,
origin: Origin,
Expand Down
2 changes: 1 addition & 1 deletion crates/wright-analyzer/tests/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn registry_has_five_first_party_rules_with_stable_ids() {
"repeated-value",
"while-without-wait",
],
"exactly five first-party rules in M12, in canonical order"
"exactly five first-party rules, in canonical order"
);
}

Expand Down
4 changes: 2 additions & 2 deletions crates/wright-analyzer/tests/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ fn while_without_wait_findings_carry_boundedness_in_json() {
}
}

// ── Lint rules and configuration (M12, #98) ──────────────────────────────────
// ── Lint rules and configuration (#98) ───────────────────────────────────────

#[test]
fn lint_rules_reports_rule_metadata_and_effective_config() {
Expand All @@ -256,7 +256,7 @@ fn lint_rules_reports_rule_metadata_and_effective_config() {
);
let result = &responses[0]["result"];
let rules = result["rules"].as_array().unwrap();
assert_eq!(rules.len(), 5, "all five M12 rules are reported");
assert_eq!(rules.len(), 5, "all five first-party rules are reported");
for rule in rules {
assert!(rule["id"].is_string(), "rules carry stable ids");
assert!(rule["defaultSeverity"].is_string());
Expand Down
9 changes: 5 additions & 4 deletions crates/wright-cli/src/bin/wright-serve.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//! `wright-serve` — thin transport adapters over the session-aware tool
//! service (M9, issue #60).
//! service (issue #60).
//!
//! Exposes the same operations as [`wright_driver::service::ToolService`]
//! over two transports:
//!
//! * **stdio JSON-lines** (`--transport stdio`): one request per line, one
//! response per line (the M4 tool style, generalized to the M9 service).
//! response per line (the legacy tool style, generalized to the current
//! service).
//! * **JSON-RPC 2.0** (`--transport jsonrpc`): standard JSON-RPC envelopes
//! with `id`/`method`/`params` and `result`/`error` responses.
//!
Expand Down Expand Up @@ -147,8 +148,8 @@ fn serve_jsonrpc(service: &mut ToolService<'_>) -> ExitCode {
let result = match method {
"request" => {
// The full params object is forwarded verbatim (op plus any
// operation arguments, e.g. mutation sources/targets, M14
// #130) so the JSON-RPC adapter maps the same request shape
// operation arguments, e.g. mutation sources/targets, #130)
// so the JSON-RPC adapter maps the same request shape
// as the stdio adapter; a params object without `op` is a
// malformed request rather than a silently empty one.
let request_line = match params {
Expand Down
4 changes: 2 additions & 2 deletions crates/wright-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `wright` — the primary Wright command-line interface (M6, issue #38).
//! `wright` — the primary Wright command-line interface (issue #38).
//!
//! A thin presentation/argv layer over [`wright_driver::CompilerSession`]:
//! every subcommand builds a [`SessionConfig`] and renders the driver's typed
Expand Down Expand Up @@ -76,7 +76,7 @@ OUTPUT CONTRACT:
OPY or OSTW; semantic reconstruction, not original-source recovery) and
reports the reconstructed text plus its SHA-256 in the `result` envelope
in JSON mode. `lint` reports findings through the same envelope with rule
metadata and the effective configuration (M12, #97/#98). `update` is
metadata and the effective configuration (#97/#98). `update` is
text-only and outside the `wright-result/v1` envelope: it updates
standalone `wright`/`wright-lsp` installs from the canonical GitHub
Release archives and refuses to overwrite package-manager-managed
Expand Down
6 changes: 3 additions & 3 deletions crates/wright-cli/tests/cli.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Black-box CLI end-to-end tests (#41): the actual `wright` executable is
//! exercised across commands, inputs, output modes, exit codes, diagnostics,
//! and stdout/stderr separation — the automation contract of the M6 CLI.
//! and stdout/stderr separation — the automation contract of the CLI.

use std::io::Write;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -207,7 +207,7 @@ fn inspect_over_workshop_input_lists_rules_and_symbols() {
let _ = std::fs::remove_dir_all(path.parent().unwrap());
}

// ── Lint (M12, #98) ──────────────────────────────────────────────────────────
// ── Lint (#98) ───────────────────────────────────────────────────────────────

#[test]
fn lint_over_workshop_input_reports_findings_in_text_and_json() {
Expand Down Expand Up @@ -248,7 +248,7 @@ fn lint_over_workshop_input_reports_findings_in_text_and_json() {
assert_eq!(
envelope["result"]["rules"].as_array().unwrap().len(),
5,
"all five M12 rules are reported"
"all five first-party rules are reported"
);
assert_eq!(
envelope["result"]["config"]["rules"]
Expand Down
4 changes: 2 additions & 2 deletions crates/wright-cli/tests/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn capability_negotiation_is_preserved() {

#[test]
fn stdio_transport_serves_mutation_operations() {
// M14 #130: the stdio adapter exposes the shared mutation operations as
// #130: the stdio adapter exposes the shared mutation operations as
// thin mappings — validated edit preview and semantic rename — with the
// same structured all-or-nothing results as in-process consumers.
let input = corpus_opy("synthetic/declarations-rules");
Expand Down Expand Up @@ -209,7 +209,7 @@ fn stdio_transport_serves_mutation_operations() {

#[test]
fn transports_are_equivalent_for_mutation_operations() {
// M14 #130: stdio and JSON-RPC map the same mutation request to the same
// #130: stdio and JSON-RPC map the same mutation request to the same
// in-process behavior.
let input = corpus_opy("synthetic/declarations-rules");
let rename = serde_json::json!({
Expand Down
2 changes: 1 addition & 1 deletion crates/wright-consumer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
description = "An external consumer fixture proving Wright's public embedding/tool contracts (M9 #61)."
description = "An external consumer fixture proving Wright's public embedding/tool contracts (#61)."

[lints]
workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/wright-consumer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! The external consumer's public API surface (M9, issue #61).
//! The external consumer's public API surface (issue #61).
//!
//! [`run_consumer`] drives every public embedding/tool workflow over one
//! input, proving that a consumer depending only on `wright-driver` can
Expand Down
2 changes: 1 addition & 1 deletion crates/wright-consumer/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! The external consumer binary (M9, issue #61).
//! The external consumer binary (issue #61).

fn main() {
let input = std::env::args().nth(1).unwrap_or_else(|| {
Expand Down
4 changes: 2 additions & 2 deletions crates/wright-consumer/src/workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn run_consumer(input: &str) -> Result<(), String> {
analyze.result.findings.as_array().unwrap().len()
);

// Lint through the shared session (M12, #98): the same pipeline with
// Lint through the shared session (#98): the same pipeline with
// rule metadata, effective configuration, and evidence-tagged findings.
let lint = session.lint();
assert!(lint.ok, "lint passes: {:?}", lint.diagnostics);
Expand Down Expand Up @@ -94,7 +94,7 @@ pub fn run_consumer(input: &str) -> Result<(), String> {
}

// Safe rename: propose, validate through the project transaction
// contract, preview (M14 #128: the shared frontend-neutral contract).
// contract, preview (#128: the shared frontend-neutral contract).
if input.ends_with(".opy") {
if let Some(name) = first_global(&source) {
let identity = wright_driver::input_identity(&source);
Expand Down
7 changes: 4 additions & 3 deletions crates/wright-driver/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ pub use wright_analyzer::registry::LintConfig;
pub enum SourceKind {
/// Detect from the input path extension or stdin content.
Auto,
/// `.opy` source through the adapter bridge (native frontend lands in M7).
/// `.opy` source through the adapter bridge (the native frontend is the
/// default path).
Opy,
/// `.ostw` / `.del` source through the native OSTW frontend (M13, #117).
/// `.ostw` / `.del` source through the native OSTW frontend (#117).
Ostw,
/// Localized vanilla Workshop text (native frontend).
Workshop,
Expand Down Expand Up @@ -112,7 +113,7 @@ pub struct SessionConfig {
/// The WIR transformation policy (`off` by default; `compat`/`aggressive`
/// opt into evidence-backed passes).
pub profile: wright_transform::Profile,
/// The lint rule configuration used by `lint` (M12, #97/#98).
/// The lint rule configuration used by `lint` (#97/#98).
///
/// [`LintConfig::default`] enables every registered rule at its default
/// severity; `--disable-rule`/`--rule-severity` on the CLI and library
Expand Down
10 changes: 5 additions & 5 deletions crates/wright-driver/src/edit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Frontend-neutral source-edit transactions (M9 #59, reconciled by M14 #128).
//! Frontend-neutral source-edit transactions (#59, reconciled by #128).
//!
//! Tools and agents propose edits as validated, source-oriented
//! [`SourceEdit`]s — never as mutations of Wright's internal IR. One
Expand Down Expand Up @@ -345,7 +345,7 @@ fn refusal(diagnostics: Vec<Diagnostic>) -> EditValidation {
}

/// A semantic rename target: the exact identifier occurrence at a 1-based
/// line/column in one source of the project (M14, #129).
/// line/column in one source of the project (#129).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RenameTarget {
/// The source identity the position names (a key of the current-sources
Expand All @@ -360,7 +360,7 @@ pub struct RenameTarget {
}

/// The outcome of a semantic rename: a validated multi-source transaction or
/// structured refusal diagnostics (M14, #129).
/// structured refusal diagnostics (#129).
///
/// The transaction edits exactly the resolved semantic identity's occurrence
/// ranges — never a whole-word scan or whole-document replacement — and is
Expand All @@ -381,7 +381,7 @@ pub struct SemanticRename {
}

/// Rename the symbol whose declaration or reference occurrence sits at a
/// position in one source of a project (M14, #129).
/// position in one source of a project (#129).
///
/// `config` and `sources` are the project and current-source snapshot of the
/// *unmodified* code, exactly as [`validate_transaction`] takes them. The
Expand Down Expand Up @@ -1198,7 +1198,7 @@ pub fn rename_symbol(source: &str, request: &RenameRequest) -> Result<SourceEdit
/// full-document [`SourceEdit`] carrying the source identity precondition.
///
/// Unlike [`rename_symbol`], this does not require a declaration in `source`.
/// This is the M9 textual contract: it is name- and boundary-driven, so the
/// This is the established textual contract: it is name- and boundary-driven, so the
/// caller must guarantee semantic identity (the project-wide rename in
/// `wright-language` targets exact semantic spans instead, so it never routes
/// through this whole-word scan).
Expand Down
2 changes: 1 addition & 1 deletion crates/wright-driver/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn resolve_stdin(config: &SessionConfig) -> Result<ResolvedInput, Diagnostic> {
let text = String::from_utf8_lossy(&bytes).into_owned();
let kind = match config.kind {
SourceKind::Auto => kind_from_stdin(&text)?,
// The native frontend (M7) reads `.opy` from stdin; the include root
// The native `.opy` frontend reads source from stdin; the include root
// defaults to the working directory.
other => other,
};
Expand Down
4 changes: 2 additions & 2 deletions crates/wright-driver/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Wright's reusable compiler/session driver (milestone M6).
//! Wright's reusable compiler/session driver.
//!
//! One orchestration path for every frontend and workflow: input discovery →
//! frontend selection (`opy` bridge, native Workshop, or protocol JSON) →
Expand Down Expand Up @@ -34,7 +34,7 @@ pub use wright_transform::Profile;
/// The driver crate name reported in result metadata.
pub const DRIVER_NAME: &str = "wright-driver";

/// The stable embedding-API contract name (M9 #56).
/// The stable embedding-API contract name (#56).
pub const EMBEDDING_CONTRACT: &str = "wright-embedding/v1";

/// A deterministic SHA-256 identity for an input or artifact.
Expand Down
2 changes: 1 addition & 1 deletion crates/wright-driver/src/opy.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! The `.opy` frontend integration for the driver.
//!
//! Since M7, the default `.opy` path is the native Rust frontend
//! The default `.opy` path is the native Rust frontend
//! (`wright_opy`): no Node, no OverPy, stdin supported. The pinned OverPy
//! adapter bridge remains available as an explicit compatibility fallback
//! when `WRIGHT_ADAPTER_PATH` is set (migration/debugging only) — it is never
Expand Down
2 changes: 1 addition & 1 deletion crates/wright-driver/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ pub struct InspectResult {
pub references: serde_json::Value,
}

/// The result of a `lint` run (M12, #98): source identity, the program
/// The result of a `lint` run (#98): source identity, the program
/// summary, the registered lint rules with their effective configuration,
/// the active configuration, and the findings.
#[derive(Debug, Clone, Default, Serialize)]
Expand Down
Loading
Loading