Skip to main content

ChangeRequest

Struct ChangeRequest 

Source
pub struct ChangeRequest {
    pub id: String,
    pub request: String,
    pub target_module: String,
    pub target_content_id: String,
    pub derived_requirement: String,
    pub proposed_test: String,
    pub patch_plan: Vec<String>,
}
Expand description

A natural-language request to change Formal AI itself, turned into a structured, reviewable, human-gated proposal.

Every field is a deterministic function of the raw request and the owned module it targets, so the whole proposal — and its content id — is reproducible.

Fields§

§id: String

Stable content-addressed id of the request.

§request: String

The raw natural-language request, verbatim.

§target_module: String

The owned src/**/*.rs module the change targets (grounded against the manifest).

§target_content_id: String

The manifest content id of the target module — provenance for the review.

§derived_requirement: String

The requirement derived from the request — the “requirements” half of the loop.

§proposed_test: String

The name of the test the change must add before it is reviewable.

§patch_plan: Vec<String>

The ordered patch plan a human or Agent CLI executes — the reviewable “patch”.

Implementations§

Source§

impl ChangeRequest

Source

pub fn for_module(request: &str, target_module: &str) -> Self

Turn request into a reviewable change proposal targeting target_module.

§Panics

Panics if target_module is not an owned src/**/*.rs file, or if request is empty once trimmed. Both are deliberate: a change request must target real, content-addressed source (never a path the repository does not ship), and an empty request has no requirement to derive.

Source

pub const fn is_human_gated(&self) -> bool

Whether applying this change stays a human decision. Always true: the request is proposal-only by construction, mirroring the self-healing loop.

Source

pub fn review( &self, gate: &BenchmarkGateReport, approval: &HumanApproval, ) -> Result<AcceptedChange, ChangeRejected>

Review the request against the same repair-loop gate as the learning ledger.

Succeeds only when the benchmark gate is green (“when tests … accept”) and approval is granted (“and the user accept[s]”), returning the merged AcceptedChange. Otherwise returns the ChangeRejected reason, so no user request is ever applied without both the tests and the human accepting.

§Errors

Returns ChangeRejected::TestsNotGreen if the gate does not permit adoption, or ChangeRejected::HumanDeclined if the human withheld approval.

Source

pub fn summary(&self) -> String

A one-line human-readable summary of the proposed change.

Render the whole change request as Links Notation — the reviewable pull request a human reads before any merge. Ends trimmed of trailing whitespace.

Source

pub fn content_id(&self) -> String

A stable content id over the request’s Links Notation.

Trait Implementations§

Source§

impl Clone for ChangeRequest

Source§

fn clone(&self) -> ChangeRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChangeRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ChangeRequest

Source§

impl PartialEq for ChangeRequest

Source§

fn eq(&self, other: &ChangeRequest) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ChangeRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more