Skip to content

Fix redaction, condition and template handling in the engine - #755

Merged
Sev7eNup merged 1 commit into
mainfrom
fix/audit-engine-runtime
Oct 30, 2026
Merged

Sev7eNup merged 1 commit into
mainfrom
fix/audit-engine-runtime

Conversation

@Sev7eNup

Copy link
Copy Markdown
Owner

Third of the smaller PRs that replace #752. It contains engine runtime fixes only: no database change, no API contract change. RT05/RT06 (notifications, with a migration) and the debugger snapshot change get their own PRs.

  • RT07: a matches condition with an invalid pattern, a regex timeout or an input above 1,048,576 characters throws ConditionEvaluationException. The run fails and names the edge. Before, this evaluated to false, which a surrounding not could invert. ADR 0015 now says so.
  • RT08: GitHub tokens are masked except for their gh?_ prefix. Before, the regex kept the whole token as its retained group.
  • RT09: log and returnData redact before truncating. A private key without an end marker is masked to the end of the value.
  • RT10: textFileEdit writes a staging file that carries the original ACL, then swaps it in with File.Replace. That keeps the DACL and metadata; Move-Item used to reset them to the inherited permissions.
  • RT12: breakpoint conditions resolve {{manual.*}}.
  • RT13: a reference counts as unresolved only if it was in the authored config. An inserted value that looks like {{…}} stays literal and no longer fails the step.

Changelog updated.

Checked locally:

  • Affected classes, incl. TemplateGrammarParityTests: 219.
  • Full NodePilot.Engine.Tests: 3,423 passed. One failure, AgentSkillTests.ShippedSccmRevisionMatchesItsValidatedSourceFiles, comes from stale CRLF sample files in this working copy (.gitattributes says LF). It does not occur on a fresh checkout.

Closes #680
Closes #681
Closes #682
Closes #683
Closes #685
Closes #686

🤖 Generated with Claude Code

- a matches condition with an invalid pattern, a regex timeout or an
  overlong input fails the run instead of evaluating to false
- GitHub tokens are masked except for their prefix
- log steps and returned data redact private keys before truncating,
  also without an end marker
- text file edits replace the file in place and keep its ACL
- breakpoint conditions resolve manual inputs
- substituted values that look like templates no longer count as
  unresolved references

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
// through the secret redactor so a `message: "pw={{step.param.pw}}"` won't leak.
var sanitized = SanitizeForLog(rawMessage);
// Redact complete values before flattening lines or truncating delimiters.
var sanitized = SanitizeForLog(_redactor.Redact(rawMessage) ?? rawMessage);
return true;

var resolved = VariableResolver.ResolveStringValue(node.Data.BreakpointCondition, previousResults, outputVariableToStepId, globalVariables) ?? "";
var resolved = VariableResolver.ResolveStringValue(node.Data.BreakpointCondition, previousResults, outputVariableToStepId, globalVariables, inputParameters) ?? "";
[Fact]
public async Task EditProtectedFile_PreservesAccessRulesAndRemovesStagingFile()
{
var directory = Path.Combine(Path.GetTempPath(), "np-text-acl-" + Guid.NewGuid().ToString("N"));
{
var directory = Path.Combine(Path.GetTempPath(), "np-text-acl-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(directory);
var path = Path.Combine(directory, "protected.txt");
@Sev7eNup
Sev7eNup merged commit e84221b into main Oct 30, 2026
17 checks passed
@Sev7eNup
Sev7eNup deleted the fix/audit-engine-runtime branch October 30, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants