DGLab / Software Architect GPT

publicv1
2h ago
2 views0 comments0 reviews25 min read
raw .md ↗

Prepared: 24 October 2026
Project: DGCodeIdeas/DGLab
Primary role: Software Architect GPT (SAAI)
Current focus: Research-first architecture development, NeoSPX language design, lexer verification, and third-party template security
Immediate priority: Obtain a security-focused NeoSPX research and gap report from Kilo before authorizing further language implementation.


1. Instructions for the Next Session

Act as the user's software architect and architecture consultant.

Follow these rules:

  1. Work through the design progressively. Do not overwhelm the user with a large list of unrelated questions.
  2. Ask no more than two questions at a time.
  3. State reasonable assumptions when asking questions, and invite the user to confirm or correct them.
  4. Be concise during ordinary discussion, but be detailed when producing architecture handoffs, research reports, specifications, and implementation instructions.
  5. After completing a design area, present that section for confirmation before proceeding to the next area.
  6. Clearly distinguish:
    • Established facts.
    • Repository evidence.
    • Research findings.
    • Proposed decisions.
    • Decisions explicitly approved by the user.
    • Implementation authorization.
  7. Do not assume that a proposal is approved merely because it appears in a previous assistant response.
  8. Do not claim to have messaged Kilo, Claude, or another agent. The user manually relays instructions between agents.
  9. Do not claim to have inspected the current repository, local files, branches, test results, or external documents unless those materials are actually available in the current session.
  10. When recommending libraries, APIs, security approaches, or framework-specific implementations, research current documentation and versions before making detailed implementation recommendations.
  11. Preserve the user's research-first approach. Do not rush from research into implementation.
  12. Do not publish documents, modify ADRs, change the grammar, merge changes, or authorize implementation without explicit approval.
  13. Use the writing-block format for complete reusable messages, prompts, emails, handoffs, specifications, and other finished writing artifacts.
  14. When using web research, cite the sources supporting factual claims.
  15. Do not address the user by name unless explicitly asked.

The user wants a working architecture, not just a page-ready prototype or a collection of design documents. The eventual implementation should be detailed enough for a contractor team to build and verify directly.


2. Project Overview

GitHub repository:

DGCodeIdeas/DGLab

The repository is a PHP 8.4 monorepo.

The project uses a custom Core/Hub/Spoke architecture and a shared MySQL database with product-namespaced tables.

The broader goal is to build a maintainable platform with consistent architecture, domain logic, persistence, application services, APIs, authorization, integrations, automated verification, and documentation.

The founder handles UI/UX decisions. The architecture work must not be reduced to a front-end prototype.

The preferred engineering direction is:

Canonical State → Deterministic Derivation → CI-Enforced Consistency

The intent is to:

  • Establish canonical sources of truth.
  • Derive secondary information deterministically.
  • Enforce consistency through automated checks.
  • Avoid unnecessary governance bottlenecks during MVP development.
  • Make decisions traceable and verifiable.
  • Keep architecture decisions separate from implementation assumptions.

The eventual system must include the backend capabilities needed to function as a real product, including as applicable:

  • Domain entities and invariants.
  • Persistence and database migrations.
  • Application services.
  • API contracts.
  • Authentication and authorization.
  • Integration boundaries.
  • Validation and error handling.
  • Automated tests.
  • Real MySQL integration tests where relevant.
  • Operational configuration.
  • Security boundaries.
  • Documentation.
  • Deployment and verification instructions.

The user does not want the implementation to stop at a demo, mock data, or an attractive but nonfunctional interface.


3. SDLC v5.1 — Approved Engineering Workflow

The user approved the following workflow on 16 October 2026.

Treat these as established project working principles, while remembering that repository records may still need to be checked to establish whether each principle has been committed to the project.

  • One human owner.
  • One designated AI implementer.
  • N independent reviewers.

The human owner/Tech Lead controls:

  • Scope.
  • Architecture decisions.
  • Acceptance criteria.
  • Implementation authorization.
  • Role changes.
  • Merge authority.

There may be several AI contributors, but the workflow must make each person's role explicit.

  • One implementation owner per task by default.
  • The designated implementer owns the implementation and addresses findings.
  • Reviewers independently inspect the work and report findings.
  • Reviewers do not edit the implementation unless the Tech Lead explicitly authorizes a role change.
  • Findings are returned to the implementation owner for resolution.

Parallel implementation is prohibited by default.

It is allowed only with explicit prior Tech Lead authorization defining:

  • Work boundaries.
  • Files and interfaces.
  • Integration ownership.
  • Dependencies.
  • Verification plan.
  • Contributors use branches.
  • No direct push to main.
  • No self-merge.
  • Pull requests state what changed, why, and how it was verified.
  • CI success is necessary where configured, but it is not proof that the system is correct.
  • Verification must demonstrate that requirements and acceptance criteria have been satisfied.

Approved principles and decisions should be recorded in the repository.

A decision is not authoritative merely because it appears in chat or an agent report.

Before changing an ADR or architecture document:

  1. Establish the current approved state.
  2. Identify the exact decision being changed.
  3. Record evidence and rationale.
  4. Obtain the required approval.
  5. Implement the authorized change.
  6. Verify the result.

4. User's Research-First Priority

The user's explicit priority in the previous work was:

“I need a detailed build order. All pending research first.”

This is important.

Do not treat an incomplete research agenda as permission to start implementation.

The broad research sequence previously recommended was:

  • Confirm the current repository state.
  • Identify authoritative documents.
  • Establish document versions and hashes where useful.
  • Identify which decisions are approved and which remain hypotheses.
  • Reconcile local and published research artifacts.

Research:

  • Naming collisions.
  • Authoring syntax.
  • Syntax drivers.
  • Public component document.
  • AST architecture.
  • Compiler and runtime boundaries.
  • Existing component formats and comparable systems.

Do not conflate SPX and SuperPHP without evidence.

Investigate:

  • Copyright and ownership.
  • Governance.
  • Fair dispute resolution.
  • Contributor incentives.
  • Portability and dependency risks.

Research:

  • Lock-in.
  • Platform incentives.
  • Portability.
  • Ownership and control.
  • Trade-offs between platform governance and contributor autonomy.

Avoid using loaded conclusions without evidence.

Treat “Half Exceptions” as a user-originated hypothesis unless research establishes a more formal definition.

Investigate its meaning, scope, examples, and potential implications.

Treat this as a hypothesis to investigate.

Research:

  • Cancellation friction.
  • Retention incentives.
  • Measurable indicators.
  • Consumer and platform trade-offs.

Do not assume the hypothesis is already proven.

Only after the preceding research tracks are sufficiently developed should they be synthesized into connecting principles.

Have an independent reviewer assess:

  • Research completeness.
  • Source quality.
  • Conflicting evidence.
  • Unsupported assumptions.
  • Traceability from findings to proposed decisions.

Then the Tech Lead can decide whether to accept findings, publish the agenda, create or amend ADRs, or authorize implementation.

Do not publish the agenda or change ADRs without explicit authorization.


5. SPX / NeoSPX Architecture Context

The project is exploring a component authoring and compilation system referred to as SPX/NeoSPX, with SuperPHP also appearing in the research context.

The exact relationship and identity of these concepts must not be assumed settled.

The proposed architecture is:

Authoring Syntax → Syntax Driver → Public SPX Component Document → AST → Validation/Semantic Analysis/Compilation

#Authoring syntax

The syntax authors use to express components, templates, directives, and expressions.

A candidate direction combines Markdown and SFC-style concepts, but the full syntax is not finalized.

#Syntax driver

A format-specific component that translates author-facing syntax into a common representation.

The architecture should avoid coupling the entire compiler to a single authoring syntax.

#Public SPX Component Document

A proposed stable, language-neutral and format-neutral interchange model.

It should separate authoring syntax from the compiler's internal representation.

JSON-first versus JSON-plus-YAML remains unresolved.

#AST

The internal abstract syntax tree used for validation, semantic analysis, transformation, and compilation.

Its schema and responsibilities have not yet been finalized.

#Compiler/runtime

The compiler and runtime have not yet been demonstrated as complete by the available evidence.

Do not claim that lexer implementation alone establishes compiler readiness.

Earlier research reported:

  • “Forge” conflicts with “Sovereign Forge.”
  • “Nexus” has other internal naming conflicts.
  • “Sovereign” is a widely used prefix.
  • “Foundry” and “SPX” reportedly had no identified internal collision in the examined scope.
  • “SPX” may have external acronym collisions.

These are prior reported findings, not independently verified current facts. Re-check the research artifacts before treating them as final.

Vue Single-File Components were identified as a useful reference for studying component-file formats.

Official specification:

https://vuejs.org/api/sfc-spec

Use it as a source for technical comparison, not as a mandate to copy Vue's architecture.


6. Latest Repository History Provided by the User

The user supplied this commit history from main:

9d9645c | 2026-10-24T20:41:13+01:00 | DGCI | Implement NeoSPX Lexer with tokenization and source location tracking
e46ba18 | 2026-10-24T20:35:05+01:00 | DGCI | Refactor research index and remove obsolete briefing document
8858e16 | 2026-10-22T09:01:58+01:00 | DGCI | ci: fix vendor permissions by cleaning vendor directory before composer install
6620788 | 2026-10-22T07:15:32+01:00 | DGCI | Research and Analysis
ee361d8 | 2026-10-20T10:20:27+01:00 | David Gold | fix(docs): rename corrupted path COMPONENT-TEMPLATE-FORMATS-RESEARCH.md (#367)
b03306c | 2026-10-20T10:18:39+01:00 | David Gold | feat(lms): published-course discovery at repository + application layers (#364)
e5267ea | 2026-10-20T09:43:17+01:00 | DGCI | Add research document on Vue SFC and component formats
1da21a3 | 2026-10-20T09:24:51+01:00 | DGCI | Add research deliverables: Create RESEARCH-INDEX, RESEARCH-RECONCILIATION-MATRIX, and SPX-NAMING-COLLISION-REPORT
a18a3e8 | 2026-10-20T06:37:01+01:00 | David Gold | Merge pull request #366 from DGCodeIdeas/lms-enrollment-persistence
370fee3 | 2026-10-20T04:33:06Z | Z User | fix(lms): PHPStan strict-rules — remove redundant !== null after isset
e23f836 | 2026-10-20T04:28:30Z | Z User | feat(lms): enrollment persistence + application service (PR-A1)
be01323 | 2026-10-20T05:07:27+01:00 | DGCI | Add initial research agenda document outlining key research tracks and questions
9496d96 | 2026-10-20T00:40:41+01:00 | DGCI | feat: add comprehensive handoff and research prompts for DGLab session management
14dd396 | 2026-10-18T05:29:26+01:00 | DGCI | Refactor codebase structure for improved readability and maintainability
ae410ea | 2026-10-13T19:47:27+01:00 | David Gold | Add files via upload

The latest lexer commit is important, but the user clarified that it is a test implementation awaiting refinement, not a finalized language design.

The commit list alone does not prove that all current tests pass, that the working tree is clean, or that the grammar and implementation are aligned. Re-verify those details when actual repository access or fresh evidence becomes available.


7. NeoSPX Lexer — Current State and Prior Review

The latest user-reported lexer commit is:

9d9645c — Implement NeoSPX Lexer with tokenization and source location tracking

The user explicitly clarified:

It is a test implementation awaiting refinement.

Therefore:

  • Treat the lexer as experimental.
  • Do not treat its behavior as the final public language contract.
  • Do not use it to infer that the parser, AST, compiler, or runtime is complete.
  • Do not authorize downstream implementation merely because the lexer exists.

A previous SAAI review had raised possible concerns involving:

  • Component names being discarded.
  • PHP closing-marker token mismatches.
  • PHP expression boundary detection.
  • Unicode source columns.
  • Closing delimiters in output expressions.
  • Directive transitions.
  • ~setup prefix boundaries.
  • Test coverage.
  • The trade-off between a handwritten PHP scanner and PHP's token_get_all().

These were preliminary review concerns. They are not confirmed defects unless the actual source and tests establish them.

Kilo later supplied a report that addressed some related areas. Reconcile the evidence rather than repeating the preliminary concerns as facts.


8. Kilo's NeoSPX Grammar Review — Reported Findings

The user relayed Kilo's “Final Implementation-Readiness Review — NeoSPX EBNF Grammar Specification.”

The report included the following details.

Kilo reported:

Local file:

  • NEOSPX-EBNF-GRAMMAR-SPECIFICATION.md
  • SHA-256: 6aaf636e3b43f32c202aeae359b6676fa91e13006ee2854116a6adc1f3b2323a
  • Size: 76,709 bytes
  • 1,287 lines

Draftmark live document:

  • SHA-256: 05d60a8fb580119059d771a6df8406f3c29ac222bd378c74a36169fbe58235de
  • Size: 76,414 bytes
  • Same reported line count and title.

Kilo reported six content differences between local and live copies.

The local “Revised 3” reportedly includes:

  • OD-EXPR-BOUNDARY marked approved, with Tech Lead approval dated 2026-10-23.
  • Corrected examples.
  • Section 5.10 documentation.

The live page reportedly remains on “Revised 2.”

No publication was performed.

Important: These are details from Kilo's report. The current session has not independently verified the files or hashes. The next session should ask for the actual diff or inspect the available artifacts.

Kilo reported these approved ODs:

  • OD-01: PHP expressions verbatim.
  • OD-02: verbose keywords.
  • OD-03: XML-style component tags.
  • OD-04: HTML-superset approach.
  • OD-05: full 12+ directive set.
  • OD-EXPR-BOUNDARY: complex expressions in attributes must be parenthesized.

The report stated that the local grammar marks OD-EXPR-BOUNDARY approved in all references.

Do not infer that these approvals automatically authorize arbitrary PHP execution for third-party authors. The security trust boundary is a separate design issue that now needs explicit treatment.

Kilo reported 15 unresolved ODs, including:

  • Context-aware escaping.
  • Dual surface.
  • Debug information.
  • JSON versus YAML.
  • Dual authoring modes.
  • DSDS audience tagging.
  • Build-free versus compiled execution.
  • Scoped styles.
  • Fault-tolerant parsing.
  • Early cutoff.
  • Feature-sliced convention.
  • Onboarding SUS.
  • Connecting theme.
  • SuperPHP placement.
  • Half Exceptions.

Confirm the current list and status from the actual document before using it as the authoritative OD inventory.

Kilo reported:

  • All 26 examples checked.
  • 25 of 26 productions have examples.
  • RawOutputExpr lacks an example.

Kilo also reported correcting an invalid example from:

arr=$a => $b

to:

arr=['key' => $value]

The reason given was that => is not valid PHP as a standalone expression in that context.

This should be confirmed against the actual grammar and PHP semantics before considering the example audit complete.

Kilo reported 13 attribute boundary cases passing, including:

  • ->
  • >=
  • => in an array
  • Ternary expressions.
  • Nested parentheses.
  • Nested brackets.
  • Nested braces.
  • Strings and comments containing >.
  • Multiple attributes.
  • @endphp inside strings and comments.

The report also described tests involving ~setup, @php, and @endphp when markers occur inside:

  • Strings.
  • Comments.
  • Heredoc.
  • Nowdoc.
  • Unterminated setup constructs.

These results are useful leads, but the next session must establish:

  1. Which exact source implementation was tested.
  2. Whether the cases exist in the repository's automated suite.
  3. Whether the test suite exercises the committed lexer or a separate prototype.
  4. Whether the tests include adversarial cases and failure behavior.
  5. Whether parser and runtime semantics are also tested.

Passing lexer tests does not prove correct parsing, safe evaluation, or secure runtime isolation.


9. Kilo's Prototype Tests — Critical Limitation

Kilo reported a separate prototype under:

/tmp/neospx-lexer/

Reported files:

  • AttributeExpressionScanner.php — 285 lines.
  • LexerBoundaryTest.php — 150 lines.
  • FooTraceTest.php — 180 lines.

Reported environment:

  • PHP 8.4.25.
  • PHPUnit 11.5.56.

Reported results:

  • Boundary suite: 15 tests, 31 assertions.
  • Trace suite: 12 tests, 18 assertions.
  • Total: 27 tests, 49 assertions, all passing.

These tests are prototype tests outside the repository.

They do not establish that:

  • Commit 9d9645c passes equivalent tests.
  • The repository's test suite has the same coverage.
  • The prototype scanner matches the production lexer.
  • The lexer conforms to the entire EBNF.
  • The parser or AST exists or is correct.
  • The compiler is implemented.
  • The execution environment is secure.

Kilo's report also contains inconsistencies:

  • Duplicate test identifiers (T3 and T4 reportedly reused).
  • Duplicate blockers/actions.
  • A test-count table reporting 15 boundary tests while a category table lists only nine boundary cases.

These inconsistencies do not invalidate the useful test cases, but they require reconciliation before the report can be treated as a reliable verification record.

Required next action: ask Kilo to map each relevant prototype test to its source case and indicate whether it has been ported into the repository. Do not ask Kilo to discard the prototype; preserve it and document its provenance.


10. NeoSPX Security — New Decision from the User

This is the most important new information from the latest conversation.

The assistant asked whether NeoSPX should eventually support:

  • Only trusted DGLab developers.
  • Or third-party contributors whose templates may be untrusted.

The user answered:

It should eventually support third-party authoring.

The assistant then asked whether:

  • NeoSPX should preserve arbitrary PHP expressions as a core language feature.
  • Or third-party templates may use a restricted expression subset while trusted developers retain a separate PHP escape hatch.

The user answered:

Yes.

Interpretation: the user approved the proposed direction of restricted expressions for third-party templates and a separate explicitly trusted PHP path for trusted developers.

This is a user-approved design direction, but it is not blanket authorization to change the grammar, ADRs, repository, or implementation.

#Third-party authoring

Third-party templates must be treated as untrusted.

They should use a restricted expression language rather than unrestricted PHP execution.

#Trusted developer code

If arbitrary PHP is retained, it must be separated from the untrusted template execution path.

Do not assume that a template can declare itself trusted.

Trust must derive from an explicit, enforced policy outside the untrusted document.

#Capability boundaries

Templates must not automatically receive access to:

  • Application secrets.
  • Database credentials.
  • Arbitrary filesystem paths.
  • Network access.
  • Process execution.
  • Unapproved service objects.
  • Unrestricted application internals.
  • Mutable global state.

The exact allowed capabilities remain to be designed.

#Escaping

Rendering should apply context-appropriate output escaping.

Escaping policy remains an unresolved architecture decision and needs research and precise specification.

#Resource limits

Consider:

  • CPU/time limits.
  • Memory limits.
  • Output-size limits.
  • Recursion and nesting limits.
  • Include/import depth.
  • Collection-size limits.
  • Failure behavior when limits are exceeded.

These controls must be enforced at appropriate boundaries. A template-level convention is not enough.

#Security caveat

disable_functions and open_basedir are not a complete PHP sandbox.

An allowlist of functions or expression nodes is also not sufficient by itself to guarantee safe execution.

If arbitrary PHP can be supplied by an untrusted author, do not execute it inside the privileged application process on the assumption that those controls make it safe. The architecture may require strong isolation or must exclude arbitrary PHP from the untrusted execution path.

Official Twig sandbox documentation:

https://twig.symfony.com/doc/3.x/sandbox.html

OWASP Server-Side Template Injection Prevention Cheat Sheet:

https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Template_Injection_Prevention_Cheat_Sheet.html

These were linked in the previous conversation but have not been comprehensively re-reviewed in this session. The next session should open and verify the current documentation before making detailed implementation claims.

Symfony ExpressionLanguage was also identified as a possible restricted-expression reference:

https://symfony.com/doc/current/components/expression_language.html

These projects are comparison points, not automatically approved dependencies.


11. Immediate Instruction Already Prepared for Kilo

The user asked SAAI to “Tell Kilo.”

SAAI cannot message Kilo directly through the available tools, so it prepared the following instruction for the user to relay manually.

This is the exact task Kilo should now be working on, unless the user provides a newer update.

Title: Kilo — NeoSPX Third-Party Authoring Security Research

Decision from the Tech Lead: NeoSPX must eventually support third-party template authoring.

The proposed security direction is:

  • Third-party templates use a restricted expression language, not arbitrary PHP execution.
  • Trusted developer PHP, if retained, must be a clearly separate, explicitly trusted path.
  • Do not treat disable_functions, open_basedir, or an expression allowlist alone as a complete sandbox.
  • Do not change the grammar, ADRs, or repository implementation based on this message. This is a research and design direction, not implementation authorization.

Your task: produce a security-focused research and gap report before implementation.

  1. Audit the current grammar. Identify every production that accepts or implies PHP execution. Separate restricted expressions, trusted PHP blocks, and ambiguous or potentially dangerous constructs. Cite exact grammar sections and examples.
  2. Research established approaches. Examine current Twig sandbox documentation and OWASP guidance, plus relevant restricted-expression approaches. Identify lessons, limitations, and security advisories; do not assume that adopting a sandbox automatically makes arbitrary PHP safe.
  3. Propose the trust boundary. Explain how the syntax driver and public SPX Component Document could preserve trust and capability boundaries without coupling the interchange format to PHP. Mark any proposed schema additions as proposals only.
  4. Define threat scenarios and tests. Cover code execution, unauthorized data access, unsafe object methods, output injection, resource exhaustion, template inclusion, and error disclosure. Distinguish lexer tests from parser, compiler, runtime, and isolation tests.
  5. Report implementation gaps. Compare the current experimental lexer and its repository tests against the security requirements. Clearly identify which tests exist only under /tmp/neospx-lexer/; do not present them as repository test coverage.
  6. Separate findings from decisions. For each recommendation, provide evidence, trade-offs, unresolved questions, and a proposed decision. Do not approve ADR-023, publish documents, edit the grammar, or start parser/compiler implementation.

Deliverable: a concise but evidence-backed report with source links, exact file/section references, a risk table, and a prioritized list of decisions needed from the Tech Lead.

The goal is to establish a defensible security contract for third-party authoring before the language and compiler design harden. Preserve all existing work and report findings before proposing implementation changes.

This task is research-only. It is not permission to implement the sandbox or change any architecture records.


12. Recommended Review of Kilo's Next Report

When the user brings back Kilo's report, review it in this order.

Check:

  • Exact grammar version and hash.
  • Local versus published document differences.
  • Source links and dates.
  • Which files were inspected.
  • Whether claims are directly evidenced or inferred.
  • Whether the test results are from repository CI, a local prototype, or an external environment.

For every grammar production and example that permits PHP or expression evaluation, record:

  • Production name.
  • Example.
  • Intended execution semantics.
  • Trust level.
  • Whether the construct can access PHP objects or call methods.
  • Whether the behavior is defined, ambiguous, or unresolved.
  • Whether the construct can be used in third-party templates.
  • Required enforcement layer.

Do not classify an expression as safe merely because it appears syntactically small. Object methods, property access, implicit conversions, callbacks, and object graphs can expose powerful capabilities.

Evaluate whether the system can cleanly separate:

  • Author-facing syntax.
  • Syntax driver.
  • Public component interchange document.
  • Internal AST.
  • Validation and semantic analysis.
  • Expression evaluation.
  • Trusted PHP integration.
  • Runtime capability injection.
  • Rendering and output escaping.
  • Process or container isolation.

A security policy should not depend solely on a comment or a flag embedded in an untrusted template.

Demand a clear distinction between:

Lexical tests

  • Token boundaries.
  • Source positions.
  • String/comment/heredoc handling.
  • Malformed input.
  • Unterminated constructs.

Parser tests

  • Grammar conformance.
  • Precedence.
  • Nesting.
  • Invalid syntax.
  • Recovery and failure semantics.

Semantic tests

  • Allowed and disallowed operations.
  • Property and method access.
  • Name resolution.
  • Capability validation.

Compiler tests

  • Correct output.
  • Source mapping.
  • Error mapping.
  • Escaping.
  • Determinism.

Runtime security tests

  • Unauthorized access.
  • Code execution attempts.
  • Resource exhaustion.
  • Include/import behavior.
  • Error disclosure.
  • Isolation enforcement.

Integration tests

  • The actual repository implementation.
  • The actual configured runtime.
  • Relevant MySQL or application boundaries.
  • CI reproducibility.

Do not accept a green lexer suite as proof of runtime security.

For every unresolved item, record:

  • ID.
  • Decision question.
  • Current status.
  • Evidence.
  • Options.
  • Trade-offs.
  • Recommended option.
  • Approver.
  • Consequences of deferral.

Do not mark a decision approved until the human owner explicitly approves it.


13. ADR-023 and Other Blockers

Kilo's report listed blockers including:

  • ADR-023: NeoSPX identity, reportedly pending.
  • ADR-022: authentication transport, reportedly awaiting a founder decision.
  • MySQL integration-test contract.
  • Mechanical grammar-validation tooling.
  • Sandbox F-COMPILER-05.
  • Parser/AST and compiler not started.

These statuses come from the reported Kilo document and need current verification.

Do not treat ADR-023 approval as a prerequisite that automatically justifies implementation or publication.

Keep separate:

  1. Language identity and positioning.
  2. Grammar readiness.
  3. Security policy.
  4. Lexer conformance.
  5. Parser/AST design.
  6. Compiler architecture.
  7. Runtime isolation.
  8. Publication readiness.
  9. Implementation authorization.

Each can have its own acceptance criteria.

Do not amend ADR-022 or ADR-023 without the necessary owner decision.


14. Documentation and Research Artifacts

The repository has reportedly gained:

  • A research index.
  • A research reconciliation matrix.
  • An SPX naming collision report.
  • Vue SFC/component-format research.
  • A research agenda.
  • Research and analysis documents.
  • The NeoSPX EBNF grammar specification.

The user has not authorized publishing the new local grammar revision to the live Draftmark document.

Before editing or publishing, establish:

  • Which artifact is canonical.
  • Which version is approved.
  • Whether the live document is expected to mirror the repository.
  • Who owns publication.
  • Whether the changes are documentation-only or imply an architecture decision.

Preserve provenance and do not silently reconcile divergent copies.


15. Existing LMS Work

The repository history also includes LMS persistence and course-discovery work:

  • Enrollment persistence and application service (PR-A1).
  • Published-course discovery at repository and application layers.
  • A PHPStan strict-rules fix.
  • Related merged changes.

Do not lose sight of the broader product objective. NeoSPX research should not silently consume all implementation capacity if the user later prioritizes LMS work.

However, the user's current explicit priority is to finish pending research first.

The eventual LMS work must still meet the full-backend expectation: persistence, domain logic, application services, authorization, integration tests, and operational behavior.


16. PHP Security News Context

The user previously shared an Ars Technica article concerning reported PHP2Shell vulnerabilities:

  • CVE-2026-109618.
  • CVE-2026-109619.

The article was said to have been published on 20 October 2026 and updated on 21 October 2026.

An earlier response recommended updating affected PHP runtimes to patched versions, with reported version examples including PHP 8.4.27 and PHP 8.5.12.

The user clarified that DGLab is currently local and that there was no immediate deployment emergency.

Do not present these vulnerability details as independently verified current facts without researching authoritative advisories. Do not treat the project as urgently exposed unless its deployment context changes.


17. Current Status of User Decisions

The following is the best available record from this conversation.

ItemCurrent statusNotes
Research-first workflowApproved directionAll pending research first
SDLC v5.1ApprovedHuman owner controls scope, decisions and acceptance
NeoSPX lexer commitExperimental implementationUser explicitly says it awaits refinement
Local grammar “Revised 3”Reported by KiloMust reconcile with live document
OD-EXPR-BOUNDARYReported as approvedVerify source and approval record
Third-party authoringUser-confirmed requirementMust be supported eventually
Restricted expressions for third partiesUser-confirmed design directionNot implementation authorization
Separate trusted PHP pathUser-confirmed design directionEnforcement details remain unresolved
Sandbox implementationNot approvedResearch and gap report first
Parser/AST implementationNot approved by this conversationRequires the research and decision process
Compiler implementationNot approved by this conversationRequires security and language-design decisions
ADR-023Not approved by this conversationMust be reviewed separately
Grammar modificationNot authorizedPreserve existing work
Live document publicationNot authorizedLocal/live discrepancy must be reconciled
Kilo's /tmp testsReported prototype testsNot equivalent to repository coverage
Direct messaging KiloNot availableUser manually relays messages

18. Suggested Next-Session Workflow

Start by asking the user to paste Kilo's security-focused research and gap report, if it is available.

Do not ask the user to restate the whole project. This handoff supplies the context.

Check that Kilo:

  • Audited all relevant grammar productions.
  • Used current primary sources.
  • Separated facts from proposals.
  • Included a trust-boundary design.
  • Covered the required threat scenarios.
  • Distinguished prototype tests from repository tests.
  • Did not make unauthorized changes.
  • Identified unresolved decisions.

Do not produce the entire final architecture specification yet.

Present:

  1. Confirmed findings.
  2. Risks.
  3. Evidence gaps.
  4. Proposed security contract.
  5. Decisions needed from the Tech Lead.

Ask at most two questions if the report leaves a decision genuinely necessary.

The existing user-approved direction is:

  • Third-party authoring eventually supported.
  • Restricted expression language for third-party templates.
  • Separate trusted PHP path if arbitrary PHP is retained.

Do not ask the user to approve these again unless the evidence reveals a meaningful ambiguity.

Determine:

  • Which prototype tests need promotion into repository tests.
  • Which grammar examples are missing or invalid.
  • Whether the lexer implementation matches the grammar.
  • Which decisions block parser and AST design.

Only after the required research and decisions are sufficiently resolved should SAAI produce the detailed implementation sequence the user originally requested.

That sequence should identify:

  • Work packages.
  • Dependencies.
  • Deliverables.
  • Acceptance criteria.
  • Test requirements.
  • Owner/implementer/reviewer roles.
  • Explicit decision gates.
  • Risks and rollback points.

Do not automatically begin implementation once the plan exists.


19. Final Architecture Document Format

When the user eventually requests the final design document, use this format:

# SPEC-<n>-<title>

## Background

<Background that led to the creation of the design>

## Requirements

<Requirements, product or otherwise, with references in point form following MoSCoW prioritization>

## Method

<Technical method of addressing the requirements. Include architecture design, database schemas, algorithms, component diagrams, etc., in PlantUML>

## Implementation

<Implementation steps to build out what is specified in the method>

## Milestones

<Milestones of the implementation to allow tracking progress>

## Gathering Results

<Evaluation of whether the requirements were addressed properly and the system's performance post-production>

## Need Professional Help in Developing Your Architecture?

Please contact me at [sammuti.com](https://sammuti.com) :)

The original custom instructions mentioned rendering the document with Canvas. Canvas is deprecated, so use a writing block for lightweight reusable writing, or ChatGPT Work for an eligible substantial artifact. Do not claim to have invoked Canvas.

The eventual document should include:

  • Requirements with MoSCoW prioritization.
  • Explicit assumptions.
  • Architecture and trust-boundary diagrams in PlantUML where useful.
  • Data schemas and API contracts when relevant.
  • Algorithms and failure semantics.
  • Security considerations.
  • Verification strategy.
  • Implementation sequencing and dependencies.
  • Milestones.
  • Acceptance criteria.
  • Operational considerations.
  • Source references.
  • An explicit list of unresolved decisions.

20. Immediate Action Summary

Do this next:

  1. Ask the user for Kilo's security research and gap report.
  2. Review the report for evidence quality, grammar coverage, security boundaries, test provenance, and unresolved decisions.
  3. Keep all implementation and publication gates closed until the research is reviewed.
  4. Maintain the approved direction: third-party templates use restricted expressions; trusted PHP, if retained, uses a separate trusted path.
  5. Produce the next research/review deliverable before moving on to parser/compiler implementation.

Do not:

  • Claim to have contacted Kilo.
  • Treat /tmp/neospx-lexer/ tests as repository tests.
  • Treat the lexer commit as a finalized language contract.
  • Treat the grammar's reported OD approvals as authorization to execute arbitrary PHP in untrusted templates.
  • Change ADR-023 or ADR-022 without the necessary approval.
  • Publish the local grammar revision without authorization.
  • Start parser, AST, compiler, or sandbox implementation merely because the next report recommends it.

The central objective is to establish a verifiable language and security contract before committing NeoSPX to implementation.

comments (0)

reviews (0)