Make the Hackpert objective loop open and extensible #47
Labels
No labels
bug
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
question
refactor
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/hackmode#47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Outcome
Build Hackpert around an open, registered objective loop rather than hard-coded recon -> attack -> LLM phases.
Parent architecture: #24
Active orchestration: #27
Prolog-RLM generation/escalation: #28
The loop must let Hackmode add new expert systems, tools, objective types, evidence evaluators, strategy selectors, and external engines without rewriting the core controller.
Two independent axes
Do not collapse execution authority and reasoning strategy into one mode enum.
Authority mode
passive— observe/reason only; no canonical mutation or provider dispatch.active— may dispatch capabilities and apply typed canonical mutations through Hackmode's validated effect boundary.Reasoning strategy
symbolic— default strategy: typed SPEC/plan/expert execution, including registered tools;direct— fallback/escalation strategy after repeated symbolic failure, blockage, or inability to produce a useful continuation;A run can therefore be
active + symbolic,active + direct,passive + symbolic, etc. Reasoning strategy does not independently grant effects.Default strategy policy: symbolic -> direct escalation -> symbolic
Hackpert should start symbolic by default.
Current prolog-rlm typed symbolic plans already support first-class
tool(...)operations. Runtime-integrated symbolic model steps can use the same registered/native tool execution path as direct mode. Therefore symbolic mode is not a read-only planning mode and does not need to surrender execution just to call tools.Normal control flow:
When symbolic execution repeatedly fails, repeatedly produces non-progress, exhausts known applicable rules/plans, or cannot synthesize a viable next step, the loop may escalate to direct mode:
The failure threshold and escalation policy must be configurable/policy-owned rather than buried in one expert. Direct mode is an escape hatch, not the default permanent controller.
Direct escalation must inherit the same authority mode, capabilities, scope, budgets, effect admission, and graph recording. Escalating from symbolic to direct never widens authority by itself.
Objective / SPEC model
The core loop should run against a typed objective/spec instead of assuming a specific pentest workflow.
Example objective concepts:
A realistic privilege-escalation objective could say:
The exact surface syntax can evolve; the important contract is a normalized/frozen objective with assertions, prerequisites, evidence requirements, stop conditions, budgets, and granted capabilities.
The SPEC/objective is the durable definition of success. A strategy switch does not mutate the goal.
Loop extension protocol
Add a registry for extensions. Each extension should be able to declare:
passiveoractive);The core loop should ask applicable extensions for candidates, rank/select under policy, execute through the canonical runtime, ingest evidence, re-evaluate the objective, and continue.
No extension gets a private state database or unrestricted shell/Tek9 authority.
CVE intelligence as an extension family
CVE retrieval should not be hard-coded into the controller. Provide expert/tool adapters that can query vulnerability intelligence and normalize results into Hackpert graph/KB facts.
Examples of extension responsibilities:
This allows NVD/OSV/GitHub Advisory/vendor-specific or future StarIntel-backed intelligence sources to be plugged in behind one typed capability contract.
CVE retrieval itself should normally be a symbolic-loop tool/expert: identify what information is missing, invoke the appropriate intelligence capability, assert normalized evidence, and continue planning.
ZeroForge research/integration boundary
Track possible ZeroForge integration as an extension/strategy adapter, not as a new authority plane.
Before implementation, pin the exact ZeroForge project/API and evaluate what it can contribute. If adopted, translate its inputs/outputs to Hackpert's canonical objective, graph, KB, action, evidence, and plan types.
Possible uses include supplying candidate analysis/artifacts to the symbolic planner or serving as a direct-escalation helper when ordinary symbolic experts cannot make progress.
ZeroForge must not bypass Hackmode scope, capabilities, effect admission, graph recording, or operation state.
Prolog-RLM relationship
#28 should plug into this registry and the symbolic-first control policy rather than hard-code a post-recon handoff.
Prolog-RLM may be used to:
The preferred steady state remains symbolic execution. RLM/direct generation exists to extend the symbolic system when the existing rules/plans cannot make progress.
LISH
LISH should eventually expose:
foothold_required,root_not_proven);symbolic -> direct -> symbolic;Acceptance direction
Hackpert #29 progress landed via #67 at
eeca3cf48c265f5fa31863996d0185cfc8722a77.Implemented the first strategy-control substrate:
:symbolicis the default reasoning strategy, non-progress/failure accumulation is policy-owned via a configurable threshold, threshold crossing produces an explicit:escalatedecision into:direct, and direct progress produces:resume-symbolic. Plan stop signals remain higher-priority and return explicit reasons. Operation/run identity is validated fail-closed.Crucially, this does not conflate strategy with authority: passive/active engine authority is unchanged, and changing symbolic/direct strategy grants no effects. No direct-model executor or second scheduler was added.
RED
07b5ec1bb0fe791f2f47d948c40bf7d2838eb40c; GREEN exact heada5697aecee31e951056e1080c28e82913f9fc7cdpassed core, monorepo and agent-framework-boundary before expected-head merge.Hackpert objective/SPEC slice merged via #70 at
f39066deb6ac902b4f152d3c389aeddaca3f51dd.Added a normalized declarative objective model with goal/precondition/evidence/constraint/stop clauses, named non-negative budget limits, deterministic capability grants, and defensive-copy accessors. The model is operation-independent and does not grant provider effects, mutate canonical state, or encode a fixed recon/attack phase order.
Acceptance direction now has a concrete representation for final-identity goals (including uid 0/root-equivalent), foothold prerequisites, evidence requirements, stops, budgets, and granted capabilities.
RED head
9cc6058ae4f0c070f9e3371ada4b477ece51f800: exact-head core failed against the missing objective API while monorepo/boundary passed.GREEN head
59ddbb8837938bb7f4d53dddcae6a80274b92368: exact-head core, monorepo, and agent-framework-boundary passed; PR #70 had zero reviews and zero unresolved threads before expected-head squash merge.Hackpert open-objective extension-registry slice merged via #73 at
d6ef37797da21bd6a0f948269d5d07c2183e64ed.Added a pure functional extension registry with stable ID/version, understood objective predicates, required capabilities, minimum authority requirement, supported reasoning strategies, deterministic listing, and applicability filtering. A candidate is applicable only when it understands the objective, its required capabilities are both objective-granted and currently available, its authority requirement is satisfied, and the current symbolic/direct strategy is supported.
Authority remains orthogonal to strategy: an active-only extension is rejected under passive authority, and selecting
:directnever widens effects. No provider/model executor, scheduler, database internals, or StarIntel product work was added.RED exact head
7c8babef95c491e6f0164da3865fc78d7a2c2cfe: core failed becauseMAKE-EXPERT-EXTENSIONdid not exist; monorepo and agent-framework-boundary passed.GREEN exact head
66a2e471bc394d1fbbaf1ef92f05576c3ebe7a00: core, monorepo, and agent-framework-boundary all passed twice across the identical-head draft/non-draft transition. PR #73 was mergeable with no review/comments before expected-head squash merge.Hackpert objective-selection slice merged via #76 at
40001b9a08a4632deb116be77f70e7fc82245856.Added pure objective re-evaluation plus deterministic extension selection with explicit decision provenance. Objective clauses are re-evaluated through a caller-supplied evidence predicate; unmet preconditions/constraints block, unmet goals/evidence remain in-progress, and satisfied objectives select no extension. Candidate records retain why each extension was applicable or rejected for objective mismatch, authority, strategy, objective capability grant, or runtime capability availability.
RED
ab9af318cb4f387ad6af7166d037fa9441482a7ffailed against the missing selection API. Intermediate head854b1da4fe58a4b0aa2637331e1ad4bafee8017aexposed a real Common Lisp accessor/helper naming collision, fixed by separating the generated candidate accessor from the admission helper. Corrected exact headc8a67426993450fdec9755fb99811c6ca46ea390passed core, monorepo, and agent-framework-boundary. The fresh non-draft core run then hit a pre-existing/nondeterministic nhooks asset-event failure on the identical SHA; rerunning that exact failed job passed without code changes, while the prior identical-head core run was already green. No test was weakened or skipped.Authority remains orthogonal to reasoning strategy and selection performs zero provider execution or canonical mutation. No database internals, second scheduler/executor, or StarIntel product work were added.
Hackpert objective-loop progress merged via #79 at
22d1dd98955990c7145798c939b7afe1230e9768.Added immutable operation/run-scoped budget accounting derived from normalized objective limits. Budget consumption returns a new state, exact zero is exhausted, over-budget consumption fails closed, unknown limits/scope are rejected, and budget state grants no execution authority or persistence ownership.
RED exact head
86181510efa4917548422ab4dd2e534e5959dfbf: core failed while monorepo/boundary passed. GREEN exact head23e7d94e3de664bce7585add1191016007e1ee48: core, monorepo, and agent-framework-boundary passed. PR #79 was mergeable with zero reviews and zero unresolved review threads before expected-head squash merge.This supplies the budget-state substrate required by the open objective loop without creating another scheduler or effect boundary.
Hackpert #29 progress merged via #82 at
cd9405f993e51855716cefaa408c6ab3d9e129f5.Added a pure budget-aware loop adapter over the existing generic strategy controller. It validates the budget state's exact operation/run/objective identity, derives
:budget-exhausteddirectly from immutable objective budget accounting, and delegates to the existing loop so a declared budget stop wins before ordinary progress/escalation. Available budget leaves normal symbolic/direct decisions unchanged. No provider execution, persistence, model execution, scheduler, or authority widening was added.RED exact head
3b0751028173e08a65c605a6398b22a3acb9fea9: core failed against the missing budget-aware loop API while monorepo and agent-framework-boundary passed. GREEN exact headbeaf4a829b9a0709947024d6431be5e0c166d3f7: core, monorepo, and agent-framework-boundary passed twice across the identical-head draft/non-draft transition. PR #82 was mergeable with zero reviews and zero unresolved review threads before expected-head squash merge.The budget adapter is intentionally loaded after
budget.lisp, avoiding forward-reference/load-order coupling.Hackpert objective-selection inspection landed via #104 at
ef737401687c5197e8e3173fd434f87d7a81cb04.The operator surface now joins bounded objective satisfaction/blocker state with extension-selection provenance: objective ID/version/status, unmet clause kind/predicate only, authority, reasoning strategy, selected extension/version, selection reason, and per-candidate admission reason. Objective arguments are excluded entirely, and mutable strings/aggregate returns are defensive copies.
BUG-FIRST: the original #101 exact-head core run exposed a pre-existing
find-apisarity/unbound-variable compile regression. That was isolated with a focused collection regression and repaired first via #103 at691b8baadd59d83be1fe806a084c7ca9b7ea74d5. #104 was then reconstructed forward from that current master rather than forcing the stale branch.GREEN exact head
63b1ed3ffacd93d327dc6f9cf59e0a574ed50019passed core, monorepo, and agent-framework-boundary. PR #104 was mergeable with zero reviews and zero unresolved threads before expected-head squash merge. No provider execution, canonical mutation, database internals, scheduler, raw Prolog execution, or StarIntel product work was introduced.Hackpert strategy-transition inspection merged via #107 at
3e58dab3d6207e9182c1d52286f41414397b38bf.Exact PR head
93c1a3d0607d0a20bd543adf01282adfcf8aae5epassed freshcore,monorepo, andagent-framework-boundaryafter reopening the draft as a normal PR due the recurring GitHubfullDatabaseIdready-for-review connector failure. PR was mergeable with zero reviews and zero unresolved threads; merged with expected-head protection.The slice exposes bounded symbolic/direct transition provenance (operation/run scope, decision kind/reason, before/after strategy and non-progress counts) and fails closed on cross-scope or decision/state disagreement. No provider execution, persistence/database internals, authority widening, second scheduler, or StarIntel product work.
Hackpert objective-budget inspection merged via #112 at
e2b1b7e6ced734d7bbdb85e862ca83ad6ea60c28.RED contract:
6072aa6d22bc907c301f070bda74f61bbec3aaa9required a pure run-scoped budget inspection API before implementation.After database-only #111 advanced
master, the Hackpert branch was reconciled forward without touchingsource/hackmode-database/**; exact head9ec0bfe8f498df83fd3dca7d735e1b1292d2422apassed freshcore,monorepo, andagent-framework-boundarytwice (draft and non-draft PR runs). PR #112 had zero reviews and zero unresolved threads and was merged with expected-head protection.The new inspection exposes objective/version, operation/run scope, deterministic per-budget limit/used/remaining/exhausted state, and aggregate exhaustion. Returned strings/entries are defensive copies. It grants no effects and introduces no persistence or scheduler authority.
Hackpert bug-first inspection hardening merged via #118.
RED:
74900d58537ea798de9a1bbce28863c5c6449222added a regression proving mutable string transition reasons could rewrite a supposedly side-effect-freeexpert-loop-transition-inspection; core failed while monorepo and boundary passed.GREEN:
e01da8f61ec2913ba86bdc91e3786a40ae879d40snapshots mutable reason strings on construction and returns defensive copies. Fresh non-draft exact-head core, monorepo, and agent-framework-boundary all passed; zero reviews and zero unresolved threads; expected-head squash merge produced6086587bfb3fe4e29f9b32c6450c15e994968e4a.No database persistence internals or StarIntel product work touched.
Hackpert #29 progress merged via #120.
Added
expert-objective-loop-step, a pure composition boundary that re-evaluates objective clauses and extension applicability on every loop iteration before delegating the next decision to the existing symbolic/direct loop. The step validates plan/objective identity, uses the current loop reasoning strategy for extension admission, derives fresh goal/no-viable-extension signals, and returns evaluation + selection + decision + next state without provider execution, canonical mutation, persistence ownership, or a second scheduler.RED exact head
4d12338f76f6b33d8d8143058e8c530445b00a71: core failed exactly becauseHACKMODE:EXPERT-OBJECTIVE-LOOP-STEPwas absent; monorepo and agent-framework-boundary passed.GREEN exact head
d0ff9b626391e6ada768d45c066a54f9765b84c5: core, monorepo, and agent-framework-boundary all passed twice across the identical-head draft/non-draft transition. PR #120 was mergeable with zero reviews and zero unresolved threads before expected-head squash merge. Merge SHA:54e61994188ab99276a64dac7454cd9f01c8dc12.No database-owned files or StarIntel product work were touched.
Hackpert bug-first slice merged via #126.
RED exact head
dbb1f7170cccca5794f1e88ab919f96f1387b10d: core failed the new regression because mutatingexpert-direct-candidate-operationchanged the stored candidate ("op-a"->"Xp-a"). The same regression also covers run ID, nested payload strings, and provenance strings.GREEN exact implementation head
37dbcb78dabcea3d7bb2875d00386922e7ef59a7: direct candidates now use private raw struct accessors, while the public operation/run/payload/provenance accessors return defensive snapshots. Internal scope validation reads the private normalized snapshot. Constructor defensive-copy semantics remain intact.Fresh non-draft #126 runs at the identical head passed core, monorepo, and agent-framework-boundary. Zero reviews and zero unresolved threads. Expected-head squash merge produced master
4dfed971f03f728eef1c935e5c5f7d86b3a36c68.No database/persistence internals, provider execution authority, second scheduler, or StarIntel product work touched.
Hackpert bug-first slice merged via #128.
RED:
fcffc429a03ec2755fd5255695eaeb44b503e548added constructor/accessor aliasing regressions forexpert-loop-state;common-lisp-corefailed while hygiene and the product-tree boundary remained green.GREEN:
a13e9cab27672b481b88073139daccb5dca7db0emakes operation/run scope strings owned defensive snapshots at constructor, copy, and public accessor boundaries. Fresh non-draft PR #128 reran the exact same head and passed common-lisp-core, hygiene, product-tree boundary, and one-open-PR lane; zero reviews and zero unresolved threads.Merged with expected-head squash protection.
masteris nowd9e358d97830018ffd0760c99fa4a67642e5272f.No database internals, StarIntel product work, authority changes, provider execution changes, or second scheduler/storage boundary.
Hackpert bug-first slice merged via #131.
RED: test-only
eeb953068ea0d3897714fe082bca77d364f423f4mutated caller-owned and accessor-returnedexpert-loop-statelast-reason strings;common-lisp-corefailed while lane/boundary/hygiene checks stayed green.GREEN: exact implementation head
471cde75f273982c5ef609c0bc67f2051a20ceb3snapshots mutable reason text on construction/transition and public access. Fresh #131 runs passedcommon-lisp-core,hygiene,keep-agent-framework-out-of-product-tree, andone-open-pr-per-agent-lane; zero reviews/unresolved threads. Expected-head squash merged asd43cee30cdbc692b33d91448563bc49ca2d87909.Ownership stayed inside Hackpert loop state/tests; no database internals or StarIntel product work.
Merged #164 as
3ebcedf63b15ceafb7c620a083135bc00d6a6d0f.Bug-first slice:
expert-objectivewas documented immutable-by-interface, but caller-owned and returned mutableid/versionstrings could rewrite objective identity in place and poison objective/plan/extension matching without a canonical mutation.RED:
af3821c48c4f2cddd6698c56cf756927f72671a9reached the ASDF test step and failed on the new aliasing regression.GREEN:
1cdf5bd754e31319448a3fbd0838a2de39f3b8ffpassed core, monorepo/hygiene, and product-tree boundary. The fix snapshots ID/version on construction and returns defensive public snapshots using private raw struct accessors.Authority unchanged: no provider execution, DB/Tek9 mutation, scheduler change, Prolog effect path, or StarIntel product work.
Auto-RAGE Hackpert slice merged via #168 as
f2d10dd17b07f7ad0fa69dbc9f84498432911324.RED: test-only head
c396578d7d81015f6f40b4ab35d438b06f727241failedcommon-lisp-coreexactly because mutating the caller-owned extension ID rewrotestable-extensiontoXtable-extension; monorepo and agent-framework-boundary were green.GREEN: implementation head
ba0e4ae664705c7c108b30d5132e73e44854625csnapshots expert-extension ID/version strings at construction and returns defensive public identity copies using private struct accessors.common-lisp-core,monorepo, andagent-framework-boundarywere all green twice on that exact head. Zero reviews/unresolved threads. No provider/effect/database/StarIntel authority change.ZeroForge direction is now authorized
The earlier tentative ZeroForge language in this issue is superseded by the explicit public-port authorization in #190.
Current direction:
Reusable semantic-port machinery is tracked upstream in
lost-rob0t/prolog-rlm#390; Hackmode product integration/public expert families are owned by #190.The two-axis invariant in this issue remains authoritative: Hackmode
passive|activeauthority is separate from Prolog-RLM reasoning strategy.