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: StringStable content-addressed id of the request.
request: StringThe raw natural-language request, verbatim.
target_module: StringThe owned src/**/*.rs module the change targets (grounded against the manifest).
target_content_id: StringThe manifest content id of the target module — provenance for the review.
derived_requirement: StringThe requirement derived from the request — the “requirements” half of the loop.
proposed_test: StringThe 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
impl ChangeRequest
Sourcepub fn for_module(request: &str, target_module: &str) -> Self
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.
Sourcepub const fn is_human_gated(&self) -> bool
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.
Sourcepub fn review(
&self,
gate: &BenchmarkGateReport,
approval: &HumanApproval,
) -> Result<AcceptedChange, ChangeRejected>
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.
Sourcepub fn links_notation(&self) -> String
pub fn links_notation(&self) -> String
Render the whole change request as Links Notation — the reviewable pull request a human reads before any merge. Ends trimmed of trailing whitespace.
Sourcepub fn content_id(&self) -> String
pub fn content_id(&self) -> String
A stable content id over the request’s Links Notation.
Trait Implementations§
Source§impl Clone for ChangeRequest
impl Clone for ChangeRequest
Source§fn clone(&self) -> ChangeRequest
fn clone(&self) -> ChangeRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChangeRequest
impl Debug for ChangeRequest
impl Eq for ChangeRequest
Source§impl PartialEq for ChangeRequest
impl PartialEq for ChangeRequest
impl StructuralPartialEq for ChangeRequest
Auto Trait Implementations§
impl Freeze for ChangeRequest
impl RefUnwindSafe for ChangeRequest
impl Send for ChangeRequest
impl Sync for ChangeRequest
impl Unpin for ChangeRequest
impl UnsafeUnpin for ChangeRequest
impl UnwindSafe for ChangeRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.