English | Français
This document is the technical manifest intended for AI agents and software engineers. It outlines all capabilities, architectural components, and public contracts exposed by ProcessForge.
ProcessForge is a cross-platform .NET system engineering library dedicated to process inspection, execution metadata analysis, and fine-grained resolution of underlying execution targets (Java wrappers, script interpreters including CMD, PowerShell, Bash, and Python).
- Cross-Platform Inspection: Resolution of executable absolute paths (on Windows through
NtQuerySystemInformation(SystemProcessIdInformation), which needs no handle on the process: the path is known for a service running under another account and for protected processes, whatever the elevation of the caller; the NT device path is translated to its drive letter, a UNC path for the network redirector, or a\\?\GLOBALROOT\Device\…path for a volume without letter; empty for the processes without image file: Idle, System, Secure System, Registry;/proc/<pid>/exeon Linux, empty for another user's process without root), complete command lines (/proc/<pid>/cmdlineon Linux,NtQueryInformationProcess(ProcessCommandLineInformation)on Windows 8.1 and later, which only needsPROCESS_QUERY_LIMITED_INFORMATION; empty for protected processes or without the right; returned on a single line, each run of NUL separators, line breaks, tabs, other control characters or whitespace other than the space becoming one space), and the account running the process (UserName): the access token of the process on Windows (DOMAIN\account, the SID when the account no longer has a name), the real UID of/proc/<pid>/statustranslated with/etc/passwdon Linux (the numeric UID when the account is not listed). On Windows the security identifier of that account is also exposed (UserSid, for exampleS-1-5-18), since account names are translated with the display language of the system. The account stays empty when the process cannot be opened (protected process, insufficient rights). - Cross-Scan Caching:
CachingProcessInspectordecorates anyIProcessInspector(new CachingProcessInspector(new CrossPlatformProcessInspector(), capacity: 4096)) and keeps the resolved metadata keyed by PID and process start time (creation time fromGetProcessTimeson Windows, field 22 of/proc/<pid>/staton Linux), so a PID reused by a new process is resolved again. A process whose start time cannot be read (exited, protected or not openable without elevation, hidden by/proc, other operating systems) is resolved on every call and never cached; the start time is read again after resolution and the result is cached only if it is unchanged. Metadata is kept as first resolved (an account renamed afterwards keeps its old name, an owner or command line that could not be read stays empty until the PID is reused); the cache is cleared when it reaches its capacity, which should exceed the number of live processes. Thread-safe; keep one instance for the scanner's lifetime and still deduplicate PIDs within a scan. Measured on Windows (not elevated, 48 distinct PIDs): 13.7 ms per scan with a per-scan cache only, 2.1 ms at steady state with the decorator. The gain on Linux has not been measured. A cache of SID-to-account translations was measured and not retained: at steady state no translation runs, since the processes whose start time cannot be read have no readable owner either. - Wrapper Resolution: Extracts underlying application targets (e.g.,
.jararchives executed viajava -jar: the token ending with.jarthat follows-jaror another.jar, so a JAR given to-cpis not the target and a JAR path containing a space is not resolved, the first command-line token ending with an extension of the host:.bat/.cmd/.ps1/.sh/.pyforcmd,powershell,pwsh,bashandsh;.pyforpyand any process whose name starts withpython;.js/.mjs/.cjsfornode;.dllfordotnet; the extension must end the token, sofoo.sharedis not a.shscript). Tokens are separated by blanks and quotes, so a path containing a space only keeps its part after the last space, and an option value such asnode --require hook.js app.jsis taken for the target. - Multi-Criteria Filtering: Evaluation engine (
ProcessExclusionFilter) matching by PID, exact name, prefix, suffix, substring (Contains), and system execution accounts (well-known SIDsS-1-5-18,S-1-5-19,S-1-5-20whatever the system language, and the namesSYSTEM,NT AUTHORITY,root), considering process name, executable path, and underlying target (TargetExecutable). - Thread-Safe Dynamic Exclusion: Method
ExcludeExactName(string processName)allows dynamic runtime additions of process or target exclusions without rebuilding the filter.
All enhancements to ProcessForge must comply with:
- Backward Compatibility: Preserve all existing public contracts. Use overloads or optional parameters.
- Code Cleanliness: Zero warnings (
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>), zero pragmas/suppressions. - Testing Standards: Test naming convention
TargetMethod_ScenarioOrCondition_ExpectedResult. - Documentation: Update both
FRAMEWORK.mdandFRAMEWORK.fr.mdimmediately upon introducing or modifying capabilities. - Validation: Full pass of
./verify.ps1.