Skip to content

Commit c67ae64

Browse files
docs(fleet): clarify automaton behavior, panel ID validation, and lock-sync helpers
1 parent 96d7edb commit c67ae64

6 files changed

Lines changed: 28 additions & 17 deletions

File tree

‎robot-repo-automaton/src/fixer.rs‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@ impl Fixer {
424424
})
425425
}
426426

427-
/// Modify a file with safety checks and rollback support
427+
/// Modify a file with safety checks.
428428
///
429-
/// Reads the modification specification from the fix, applies it to the file,
430-
/// and rolls back if the modification produces invalid content.
429+
/// Reads the modification specification from the fix and rejects invalid
430+
/// structured content before atomically replacing the original file.
431431
fn apply_modify(
432432
&self,
433433
target_path: &Path,
@@ -542,11 +542,8 @@ impl Fixer {
542542

543543
/// Create a file with template expansion
544544
///
545-
/// Supports template variables:
546-
/// - `gitbot-fleet` - Repository name
547-
/// - `hyperpolymath` - Repository owner
548-
/// - `{{LICENSE}}` - License identifier
549-
/// - `{{YEAR}}` - Current year
545+
/// Supports the literal `gitbot-fleet` as a repository-name placeholder,
546+
/// plus `{{LICENSE}}`, `{{YEAR}}`, `{{AUTHOR}}`, and `{{EMAIL}}`.
550547
fn apply_create(
551548
&self,
552549
target_path: &Path,
@@ -938,6 +935,8 @@ fn resolve_from_existing_ancestor(path: &Path) -> Result<PathBuf> {
938935
}
939936
}
940937

938+
/// Return whether the character at byte offset `index` is escaped by an odd run
939+
/// of backslashes. `index` must be a UTF-8 boundary.
941940
fn is_escaped(value: &str, index: usize) -> bool {
942941
value[..index]
943942
.bytes()

‎robot-repo-automaton/src/fleet.rs‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,10 @@ impl FleetCoordinator {
157157
}
158158
}
159159

160-
/// Report fix outcomes to Hypatia's neurosymbolic learning loop.
160+
/// Record a fix outcome as a fleet finding for Hypatia's learning loop.
161161
///
162-
/// When robot-repo-automaton applies a fix (or fails to apply one),
163-
/// this method records the outcome so the learning engine can adjust
164-
/// confidence thresholds and propose new rules based on real-world
165-
/// success/failure rates.
162+
/// If connected, records the pattern, result, fix type, and confidence in
163+
/// the shared context. If disconnected, this is a no-op.
166164
pub fn report_fix_outcome(
167165
&mut self,
168166
pattern: &str,

‎robot-repo-automaton/src/hooks.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ impl PreCommitChecker {
279279
Ok(violations)
280280
}
281281

282-
/// Check for secrets in staged files
282+
/// Return secret findings for staged files.
283+
///
284+
/// Secret scanning is not yet implemented, so this currently returns an
285+
/// empty list.
283286
pub fn check_secrets(&self) -> Result<Vec<String>> {
284287
let findings = Vec::new();
285288

‎robot-repo-automaton/src/hypatia.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ impl CicdHyperAClient {
205205

206206
/// Fetch a ruleset from the registry.
207207
///
208-
/// Tries the Hypatia API first; falls back to loading rules from the
209-
/// local verisimdb-data recipes directory if the API is unavailable.
208+
/// Tries the Hypatia API first; falls back to local recipes when the request
209+
/// fails, returns a non-success status, or does not contain a valid ruleset.
210210
pub async fn fetch_ruleset(&self, ruleset_id: &str) -> crate::Result<Ruleset> {
211211
tracing::info!(
212212
"Fetching ruleset: {} from {}",
@@ -268,6 +268,8 @@ impl CicdHyperAClient {
268268
self.load_recipes_from(ruleset_id, &recipes_dirs)
269269
}
270270

271+
/// Load recipes from the first existing candidate directory, or use the
272+
/// built-in RSR rules when no valid recipes are found.
271273
fn load_recipes_from(
272274
&self,
273275
ruleset_id: &str,

‎scripts/check-lock-sync.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ USES_FILE="$(mktemp "${TMPDIR:-/tmp}/check-lock-sync.uses.XXXXXX")"
8585
RAW_USES_FILE="$(mktemp "${TMPDIR:-/tmp}/check-lock-sync.raw-uses.XXXXXX")"
8686
trap 'rm -f "$USES_FILE" "$RAW_USES_FILE"' EXIT
8787

88+
# Print each valid scalar `uses` value from the workflow at $1, one per line.
89+
# Return non-zero if parsing fails or a value is empty, non-string, or contains
90+
# a tab or line break.
8891
extract_uses_yq() {
8992
local workflow="$1"
9093

@@ -97,6 +100,9 @@ extract_uses_yq() {
97100
yq -r '.. | select(type == "!!map" and has("uses")) | .uses | select(type == "!!str")' "$workflow"
98101
}
99102

103+
# Print each valid scalar `uses` value from the workflow at $1, one per line.
104+
# Return non-zero if parsing fails or a value is empty, non-string, or contains
105+
# a tab or line break.
100106
extract_uses_ruby() {
101107
local workflow="$1"
102108

@@ -106,6 +112,8 @@ require "yaml"
106112
workflow = ARGV.fetch(0)
107113
document = YAML.safe_load(File.read(workflow), aliases: true)
108114
115+
# Traverse a parsed workflow and emit its valid scalar `uses` values.
116+
# Abort if a value is empty, non-string, or contains a tab or line break.
109117
def emit_uses(node, workflow)
110118
case node
111119
when Hash

‎shared-context/src/panel.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ use std::path::PathBuf;
3434
pub struct PanelId(pub String);
3535

3636
impl PanelId {
37-
/// Create a new panel ID, validating PascalCase format.
37+
/// Create a panel ID whose non-reserved name starts with an uppercase letter
38+
/// and contains only alphanumeric characters.
3839
pub fn new(name: &str) -> Result<Self, PanelError> {
3940
if name.is_empty() {
4041
return Err(PanelError::InvalidName("Panel name cannot be empty".into()));

0 commit comments

Comments
 (0)