Skip to content

Implement HTTP template pipeline and CLI commands#68

Open
ktech643 wants to merge 8 commits into
mainfrom
ktech643-httpt-pipeline
Open

Implement HTTP template pipeline and CLI commands#68
ktech643 wants to merge 8 commits into
mainfrom
ktech643-httpt-pipeline

Conversation

@ktech643

Copy link
Copy Markdown
Collaborator

Implemented the JavaScript HTTP Template pipeline and CLI commands.

Changes:

  • Added hydrate support for placeholder replacement.
  • Added parse support for converting hydrated HTTP into IR.
  • Added build and execute core facade flow.
  • Implemented hydrate, parse, run, and emit CLI commands.
  • Added dynamic headers and dynamic body support.
  • Added JSON, base64, and provided body handling.
  • Preserved duplicate and empty headers.
  • Added BodyConflictError handling.
  • Fixed Windows npm test command.

Validation:

  • npm.cmd test passes with 49 tests.

@TarasMazepa TarasMazepa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's start smaller. I see that there were some trade-offs made during implementation.

@ktech643

ktech643 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

I went back through the incubation spec and tightened the implementation around the parts that were not being tested strictly enough.

The PR now checks the full pipeline more carefully, not just the final IR. It validates the hydrated request output, shift maps, chained hydrate functions, dynamic provided-body handling, and the CLI flag format from the spec.

I also fixed a GitHub CI issue caused by Windows vs Linux line endings in the fixture maps, so the tests should behave consistently now.

Local result: 53/53 tests passing.

Latest changes are pushed to the same PR branch, so the existing PR should pick them up automatically.

@ktech643

ktech643 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

I’ve pushed another update to cover the remaining items from the incubation spec.

This adds static contract verification, CLI verify support, CLI stream file mapping, smart stream extraction from data, async SDK input support for readable/byte templates, stream reference validation, and the remaining Phase 3 fixtures.

I also added tests for the new behavior and the full local suite is passing:

75/75 tests passing

@ktech643
ktech643 requested a review from TarasMazepa July 2, 2026 11:26
@ktech643

ktech643 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

I fixed hydrate(template, data, streams = []) according to incubation.md section 1.2. It now runs as a single-pass character state machine, supports streamed template input, tracks source-map cursor shifts during hydration, handles dynamic body/head insertion correctly, and throws BodyConflictError immediately when required.

I also added tests for chunked stream hydration and ran the full suite.

Result: npm.cmd test passes with 77/77 tests.

Please review it when you get a chance. If you still see anything that does not match the specification, let me know and I’ll focus on that exact part next.

@ktech643

ktech643 commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

I cleaned it up again and made the hydrate state machine easier to read.

The behavior is the same, but the code is flatter now with clearer state names and less helper-heavy structure.

Tests are passing: 77/77.

If it still feels too much for one review, I’m happy to split it further and start with only the basic tag replacement + source-map part.

@TarasMazepa TarasMazepa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too big, let's close

@ktech643

ktech643 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

That is our old work and new work on pull no 77, you can check there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants