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
2 changes: 0 additions & 2 deletions crates/wright-analyzer/src/analysis.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Workshop-specific static analyses over Workshop IR and CFG.
//!
//! Each analysis produces [`Finding`]s with a stable code, a severity, a
//! human-readable message, and the offending rule/action/value and span. The
//! v0.2 analysis set is deliberately small and low-false-positive:
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-analyzer/src/cfg.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Control-flow graphs over Workshop IR rules.
//!
//! [`Cfg`] flattens a rule's structured actions (If/While/ForGlobalVariable)
//! into basic blocks while preserving the structured semantics: branch edges,
//! loop back-edges, and loop exits are explicit [`EdgeKind`]s, so timing and
Expand Down
14 changes: 0 additions & 14 deletions crates/wright-analyzer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
//! 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):
//!
//! * [`symbols`] — symbol tables, reference indices, and usage queries;
//! * [`cfg`] — control-flow graphs and timing-aware primitives;
//! * `analysis` — Workshop-specific static analyses producing findings;
//! * `service` — the transport-neutral read-only tool/agent interface.
//!
//! The crate is protocol-agnostic: it operates on [`wir::Program`], and the
//! `wright-tool` binary wires the pipeline in `wright-core` (protocol →
//! internal HIR → Workshop IR) into these services.

pub mod analysis;
pub mod cfg;
pub mod registry;
Expand Down
14 changes: 0 additions & 14 deletions crates/wright-analyzer/src/registry.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
//! 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`]
//! that controls which rules are active and at what severity.
//!
//! # Contract
//!
//! * Rule IDs are stable `&'static str` values that match the `code` field on
Expand All @@ -28,8 +22,6 @@ use crate::analysis::{
};
use crate::cfg::Cfg;

// ── Rule metadata ─────────────────────────────────────────────────────────────

/// Static metadata for one lint rule.
///
/// All fields are `&'static str` / `&'static [&'static str]` to support
Expand Down Expand Up @@ -58,8 +50,6 @@ pub struct RuleMeta {
pub tags: &'static [&'static str],
}

// ── Per-rule configuration ────────────────────────────────────────────────────

/// Configuration applied to one rule at registry execution time.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RuleConfig {
Expand Down Expand Up @@ -113,8 +103,6 @@ impl From<Severity> for SeverityLabel {
}
}

// ── Lint configuration ────────────────────────────────────────────────────────

/// The deterministic lint configuration passed to [`LintRegistry::run`].
///
/// [`LintConfig::default`] enables all registered rules at their default
Expand Down Expand Up @@ -186,8 +174,6 @@ impl LintConfig {
}
}

// ── Registry ──────────────────────────────────────────────────────────────────

/// One registered rule: its stable metadata and the analysis implementation.
struct RegistryEntry {
meta: RuleMeta,
Expand Down
5 changes: 0 additions & 5 deletions crates/wright-analyzer/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
//! The read-only agent/tool interface over Wright's semantic services.
//!
//! [`SemanticService`] answers transport-neutral JSON requests about a
//! compiled Workshop IR program: program summary, rule/action/value lookup,
//! symbol/reference inspection, usage, CFG inspection, and static-analysis
//! findings. The request/response models ([`Request`], [`Response`]) are
//! plain serde data with no transport or UI dependency, and there is no
//! mutation or AST-editing contract in v0.2.
//!
//! The `wright-tool` binary wires the pipeline (protocol JSON → internal HIR
//! → Workshop IR) into this service and serves requests over stdin/stdout.

use serde::{Deserialize, Serialize};
use serde_json::json;
Expand Down
3 changes: 0 additions & 3 deletions crates/wright-analyzer/src/symbols.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Symbol tables, reference indices, and usage queries over Workshop IR.
//!
//! [`SemanticIndex`] is the read-only semantic query surface for tooling and
//! agents: it enumerates every symbol (global/player variables, subroutines,
//! rules), records every reference site (declarations, reads, writes, calls,
Expand Down Expand Up @@ -251,7 +249,6 @@ impl<'a> Builder<'a> {
)?;
}

// References from rule bodies.
for id in 0..self.program.rules.len() {
self.walk_rule(RuleId::from_index(id))?;
}
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-bench/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! `wright-bench` — reproducible performance and resource benchmarks (#53).
//!
//! Measures compile latency, peak RSS, and generated-resource usage (emitted
//! Workshop bytes, WIR node counts) for the versioned corpus through the
//! real driver path (`CompilerSession::compile`), and enforces declared
Expand Down
8 changes: 2 additions & 6 deletions crates/wright-cli/src/bin/wright-serve.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//! `wright-serve` — thin transport adapters over the session-aware tool
//! service (issue #60).
//!
//! Exposes the same operations as [`wright_driver::service::ToolService`]
//! over two transports:
//!
Expand All @@ -10,9 +7,8 @@
//! * **JSON-RPC 2.0** (`--transport jsonrpc`): standard JSON-RPC envelopes
//! with `id`/`method`/`params` and `result`/`error` responses.
//!
//! Both are thin mappings: no semantic logic lives here, so behavior is
//! identical to in-process consumers. MCP is intentionally not implemented —
//! no agent-integration evidence justified it in v1.
//! MCP is intentionally not implemented — no agent-integration evidence
//! justified it in v1.

use std::io::{BufRead, Write};
use std::process::ExitCode;
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-cli/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! The authoritative structured command model for `wright`.

use std::path::PathBuf;

use clap::{Args, Parser, Subcommand, ValueEnum};
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-cli/src/completion.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Shell completion generation, detection, installation, and refresh (#186).
//!
//! Provides the authoritative lifecycle for shell completions generated from
//! the `clap` command model. Supports pure generation (`wright completion <shell>`),
//! automatic or explicit installation into conventional user-local locations
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! `wright` — the primary Wright command-line interface.

mod cli;
mod completion;
mod present;
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-cli/src/provider.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! First-party language-provider management commands.

use wright_driver::{OpyProviderConfig, OpyProviderError, ResolvedOpyProvider};

/// Explicitly install/update the first-party OPY provider.
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-cli/src/update.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! `wright update` — self-update for standalone installations (#116).
//!
//! Resolves the latest stable Wright release from the canonical GitHub
//! Release contract (the same archives and checksums `install.sh` and the
//! package-manager manifests consume), verifies the published SHA-256
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-consumer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! 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
//! compile/check/analyze/query and validate edits without internal IR
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-consumer/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! The external consumer binary (issue #61).

fn main() {
let input = std::env::args().nth(1).unwrap_or_else(|| {
eprintln!("usage: wright-consumer <input>");
Expand Down
10 changes: 0 additions & 10 deletions crates/wright-consumer/src/workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ pub fn run_consumer(input: &str) -> Result<(), String> {
};
let mut session = CompilerSession::new(config).map_err(|error| error.message)?;

// Check through the shared session.
let check = session.check();
assert!(check.ok, "check passes: {:?}", check.diagnostics);

// Compile through the shared session.
let compile = session.compile();
assert!(compile.ok, "compile passes: {:?}", compile.diagnostics);
let output = compile.result.output.expect("compiled output");
Expand All @@ -27,7 +25,6 @@ pub fn run_consumer(input: &str) -> Result<(), String> {
&output.sha256[..16]
);

// Analyze through the shared session.
let analyze = session.analyze();
assert!(analyze.ok, "analyze passes");
println!(
Expand All @@ -36,8 +33,6 @@ pub fn run_consumer(input: &str) -> Result<(), String> {
analyze.result.facts["rules"].as_array().unwrap().len()
);

// 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);
println!(
Expand All @@ -46,7 +41,6 @@ pub fn run_consumer(input: &str) -> Result<(), String> {
lint.result.rules.as_array().unwrap().len()
);

// Session-aware tool service queries (structured owned results).
let service = ToolService::new(&mut session).map_err(|error| error.message)?;
let capabilities = service.handle(&ToolRequest::Capabilities);
match capabilities {
Expand Down Expand Up @@ -76,8 +70,6 @@ pub fn run_consumer(input: &str) -> Result<(), String> {
let response = service.handle(&request);
match response {
wright_driver::service::ToolResponse::Ok { result } => {
// The tool lint path carries the same evidence-tagged
// findings as the session/CLI path.
if matches!(request, ToolRequest::Lint) {
let findings = result["findings"].as_array().unwrap();
for finding in findings {
Expand All @@ -94,8 +86,6 @@ pub fn run_consumer(input: &str) -> Result<(), String> {
}
}

// Safe rename: propose, validate through the project transaction
// 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
10 changes: 0 additions & 10 deletions crates/wright-core/src/hir/convert.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//! Conversion from the `wright/opy-hir` bridge protocol into the internal
//! Opy HIR model (`wright_ir::hir`).
//!
//! The protocol payload is expected to be already validated (see
//! [`super::parse_str`]); this conversion maps it onto the typed, arena-based
//! model, resolving name references to typed IDs and rejecting operators
Expand Down Expand Up @@ -55,14 +52,11 @@ impl<'a> Builder<'a> {
}

fn build(mut self) -> Result<wright_ir::hir::Program, IrError> {
// Phase A: file registry.
for file in &self.protocol.files {
let id = self.target.files.push(SourceFile::new(file.path.clone()));
self.files.insert(file.id, id);
}

// Phase A: symbols with empty bodies; maps are populated before any
// body conversion so references resolve regardless of order.
for declaration in &self.protocol.declarations {
match declaration {
Declaration::GlobalVariable {
Expand Down Expand Up @@ -143,7 +137,6 @@ impl<'a> Builder<'a> {
}
}

// Phase B: merge subroutine definitions into the subroutine table.
for entry in &self.protocol.rules {
if let RuleEntry::SubroutineDef {
name,
Expand Down Expand Up @@ -183,7 +176,6 @@ impl<'a> Builder<'a> {
}
}

// Phase C: initializers, constant values, and macro bodies.
for declaration in &self.protocol.declarations {
match declaration {
Declaration::GlobalVariable {
Expand Down Expand Up @@ -230,7 +222,6 @@ impl<'a> Builder<'a> {
}
}

// Phase D: rules.
for entry in &self.protocol.rules {
if let RuleEntry::Rule(rule) = entry {
let event = wright_ir::hir::Event {
Expand Down Expand Up @@ -263,7 +254,6 @@ impl<'a> Builder<'a> {
}
}

// Phase E: the settings carrier (spans map through the registry).
if let Some(settings) = &self.protocol.settings {
let mut converted = Vec::with_capacity(settings.children.len());
for child in &settings.children {
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-core/src/hir/dump.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Deterministic debug/pretty dump for Opy HIR v1 programs.
//!
//! The dump is a stable, human-readable rendering intended for tests and
//! issue reports. It is not part of the wire contract: the same validated
//! payload always produces the same dump, in payload order.
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-core/src/hir/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Structured errors for Opy HIR v1 ingestion.
//!
//! Every failure carries a stable code, a message, and — when the offending
//! source position is known — a span. Human-readable wording is not part of
//! the stable contract; `code` is.
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-core/src/hir/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Opy HIR v1 — the Wright-owned frontend protocol consumed by the core.
//!
//! The wire contract is specified in
//! [`docs/hir/opy-hir-v1.md`](../../../../docs/hir/opy-hir-v1.md). This module
//! provides serde protocol types, envelope and structural validation, and a
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-core/src/hir/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Serde protocol types for `wright/opy-hir` version `1.0.0`.
//!
//! These types mirror [`docs/hir/opy-hir-v1.md`](../../../../docs/hir/opy-hir-v1.md).
//! Unknown fields on known nodes are tolerated so an additive producer change
//! inside the same major version does not break the consumer; unknown node
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-core/src/hir/validate.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Opy HIR v1 validation.
//!
//! Validation follows the order in `docs/hir/opy-hir-v1.md` §8: the protocol
//! envelope is checked first (in [`super::parse_value`]), then unknown node
//! kinds are rejected with the offending kind name and span, then the payload
Expand Down
9 changes: 0 additions & 9 deletions crates/wright-core/src/signatures.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
//! Canonical signature context for ambiguous enum member resolution.
//!
//! Cutover shim (wright#143): the parse-context contract is owned by
//! `workshop-rs` (`workshop_rs::signatures`); this module re-exports it so
//! Wright's manifest owner (`wright-opy`) and the Workshop parse path keep
//! implementing/consuming one trait. No independent implementation lives
//! here. Removal path: when the OPY provider extracts to `opy-rs`, this shim
//! disappears and importers use `workshop_rs::signatures` directly.

pub use workshop_rs::signatures::*;
9 changes: 0 additions & 9 deletions crates/wright-driver/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
//! Session configuration owned by the compiler driver.
//!
//! [`SessionConfig`] describes one driver run: where the input comes from,
//! which frontend handles it, optional frontend overrides (Workshop locale,
//! `.opy` include root), where compiled output goes, which presentation
//! format the result is intended for, and the lint rule configuration. The
//! CLI, library consumers, and later tool/LSP adapters all construct the
//! same configuration type.

use std::path::PathBuf;

pub use wright_analyzer::registry::LintConfig;
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-driver/src/diag.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Structured diagnostics shared by every driver workflow.
//!
//! A [`Diagnostic`] is the machine-readable unit of compiler feedback: a
//! stable `code`, the pipeline `stage` that produced it, a `severity`, a
//! human message, an optional source span, and the input's origin metadata.
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-driver/src/edit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! 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
//! [`EditTransaction`] carries one or more file edits with exact source
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-driver/src/input.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Source/project discovery: input kinds, path normalization, and stdin.
//!
//! The driver resolves one [`SessionConfig`] into a concrete
//! [`ResolvedInput`]: the input text, the concrete frontend kind, a stable
//! display identity for diagnostics, an include root for `.opy`, and a
Expand Down
9 changes: 0 additions & 9 deletions crates/wright-driver/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
//! 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) →
//! validation → lowering → analysis → emission. The `wright` CLI is a thin
//! presentation layer over this crate, and later tool/LSP adapters reuse the
//! same [`CompilerSession`]. Every workflow returns a typed [`Envelope`] whose
//! JSON serialization is the machine-readable CLI contract.

// Diagnostics are the primary error type of this crate, so error-returning
// functions legitimately carry the full `Diagnostic` value; boxing it would
// add an allocation per error without a measured benefit.
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-driver/src/opy.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! The `.opy` frontend integration for the driver.
//!
//! 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
Expand Down
6 changes: 0 additions & 6 deletions crates/wright-driver/src/opy_provider.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
//! Resolution and installation of the first-party OPY LPP provider (#244).
//!
//! This module owns only distribution state. The provider process and wire
//! protocol remain owned by `wright-lpp`, and OPY project loading remains an
//! `opy-rs` concern.

use std::fmt;
use std::io::{Read, Write};
use std::path::Path;
Expand Down
2 changes: 0 additions & 2 deletions crates/wright-driver/src/progress.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! Transport-neutral workflow progress events.
//!
//! The driver reports semantic workflow boundaries without terminal strings,
//! ANSI, timing, or presentation policy. CLI and embedding consumers may
//! observe these events independently.
Expand Down
Loading