Consolidate shell policy path facts - #1945
Merged
Merged
Conversation
Aaronontheweb
enabled auto-merge (squash)
August 14, 2026 06:49
|
|
||
| Assert.Same(candidate.SourceOccurrence, facts.SourceOccurrence); | ||
| Assert.Equal(ShellPolicyPathResolutionState.Known, facts.RealScope.State); | ||
| Assert.Equal("/work", facts.RealScope.Path?.Value); |
|
|
||
| var facts = evaluation.Projection.PathFacts.For(candidate.Id); | ||
|
|
||
| Assert.Equal("/work/sub", facts.RealScope.Path?.Value); |
| var facts = evaluation.Projection.PathFacts.For(candidate.Id); | ||
|
|
||
| Assert.Equal("/work/sub", facts.RealScope.Path?.Value); | ||
| Assert.Equal("/work", facts.Real?.ResolutionBase.Path?.Value); |
|
|
||
| var facts = evaluation.Projection.PathFacts.For(candidate.Id); | ||
|
|
||
| Assert.Equal("/tmp", facts.IntentScope?.Path?.Value); |
| var facts = evaluation.Projection.PathFacts.For(candidate.Id); | ||
|
|
||
| Assert.Equal("/tmp", facts.IntentScope?.Path?.Value); | ||
| Assert.Contains(facts.FallbackScopes, scope => scope.Path?.Value == "/work"); |
Comment on lines
+310
to
+326
| foreach (var fact in resolvedPaths.Facts.Where(static fact => | ||
| fact.Source.Origin == ShellPolicyPathOrigin.AuthoredArgument)) | ||
| { | ||
| if (fact.Source.AuthoredPathShape == ShellPathShape.Posix | ||
| && pathStyle != ShellPathStyle.Posix | ||
| || fact.Source.AuthoredPathShape == ShellPathShape.Windows | ||
| && pathStyle != ShellPathStyle.Windows | ||
| || fact.Source.DomainKind is not | ||
| (ShellPolicyPathDomainKind.Exact or ShellPolicyPathDomainKind.FiniteSet) | ||
| || fact.State != ShellPolicyPathResolutionState.Known | ||
| || fact.Paths.Count == 0 | ||
| || fact.Paths.Any(path => | ||
| !safeRoots.Any(root => IsSafePath(path.Value, root)))) | ||
| { | ||
| return false; | ||
| } | ||
| } |
Comment on lines
+338
to
+349
| foreach (var fact in resolvedPaths.Facts.Where(static fact => | ||
| fact.Source.Origin == ShellPolicyPathOrigin.EffectiveArgument)) | ||
| { | ||
| if (fact.Source.DomainKind is not | ||
| (ShellPolicyPathDomainKind.Exact or ShellPolicyPathDomainKind.FiniteSet) | ||
| || fact.State != ShellPolicyPathResolutionState.Known | ||
| || fact.Paths.Count == 0 | ||
| || fact.Paths.Any(path => !IsSafePath(path.Value, intentDirectory))) | ||
| { | ||
| return false; | ||
| } | ||
| } |
Comment on lines
+351
to
+362
| foreach (var fact in resolvedPaths.Facts.Where(static fact => | ||
| fact.Source.Origin == ShellPolicyPathOrigin.Redirect)) | ||
| { | ||
| if (fact.Source.RedirectMode != FileRedirectMode.Input | ||
| || fact.Source.DomainKind != ShellPolicyPathDomainKind.Exact | ||
| || fact.State != ShellPolicyPathResolutionState.Known | ||
| || fact.Paths.Count != 1 | ||
| || !IsSafePath(fact.Paths[0].Value, intentDirectory)) | ||
| { | ||
| return false; | ||
| } | ||
| } |
| var root = Directory.CreateTempSubdirectory("netclaw-shell-recheck-"); | ||
| try | ||
| { | ||
| var deniedDirectory = Directory.CreateDirectory(Path.Combine(root.FullName, "denied")); |
Comment on lines
+152
to
+167
| foreach (var segment in path.Split(separator, StringSplitOptions.RemoveEmptyEntries)) | ||
| { | ||
| if (segment == ".") | ||
| continue; | ||
|
|
||
| if (segment == "..") | ||
| { | ||
| if (segments.Count == 0) | ||
| return string.Empty; | ||
|
|
||
| segments.RemoveAt(segments.Count - 1); | ||
| continue; | ||
| } | ||
|
|
||
| segments.Add(segment); | ||
| } |
Aaronontheweb
added a commit
that referenced
this pull request
Aug 20, 2026
* Sync delta specs for the last two completed changes Apply the redirect-shared-temp-to-session-scratch delta to session-cwd and tool-approval-gates. The OpenSpec CLI applied both files. Merge the surface-reminder-schedule-failures delta into netclaw-scheduling by hand. PR #2024 already corrected that requirement against the merged code, so a programmatic apply would undo those corrections. Keep the corrected text and add the scheduling-failure content: - An execution failure and a scheduling failure share one ConsecutiveFailures count. - A successful reschedule alone does not reset the count. - An unattended reschedule site emits ReminderScheduleFailed at Warning severity, and ReminderAutoDisabled at Critical severity on the threshold. - The set_reminder create path and update path return the error to the caller and emit no alert. Drop three stale delta claims. The merged code disables a reminder. It does not set a "paused" status and it does not write tasks.json. ReminderExecutionActor has no ExecutionTimeoutSeconds constant, so the one-hour absolute limit stands. * Archive the last two completed OpenSpec changes Move each change to openspec/changes/archive/2026-08-19-<name>/. The code of both changes is merged on dev. - surface-reminder-schedule-failures: PR #1886. - redirect-shared-temp-to-session-scratch: PRs #1890, #1925, #1926, #1945, and #1956. Tick task 4.3 of redirect-shared-temp-to-session-scratch. The full pr_validation suite ran green on Windows against current dev. Leave the other boxes unticked. The maintainer accepts tasks 4.5 and 4.6 of surface-reminder-schedule-failures as guaranteed by construction. The maintainer accepts task 6.4 of that change and task 4.4 of redirect-shared-temp-to-session-scratch as an eval-credentials gap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Security boundaries
Validation
This is the typed-fact consolidation slice for
simplify-shell-policy-evaluator; obsolete compatibility helpers are removed in the following net-negative slice.