HNHacker News
TopNewBestAskShowJobs

artpar

425 karma · joined February 22, 2012

https://github.com/daptin/daptin
submissionscomments
artpar··on A stateful browser agent using self-healing DOM maps
No it is not open-source. But it is not obfuscated either, so you can always look into the code by downloading the plugin from chrome webstore if (and these days llms can help with that a lot) if you are into that kind of verification.
artpar··on A stateful browser agent using self-healing DOM maps
That's exactly what is it doing. The workflows are pretty much js snippets in itself you can see in the "code" tab (in the plugin when you select a saved workflow).
artpar··on A stateful browser agent using self-healing DOM maps
Yeah like so many legacy things, unfortunately they are not going away that fast. People are still clicking on these tedious interfaces day in day out to get all the "smaller" stuff running. Even if every one agreed on the "One Best UI", it would take decades to convert all the existing ones before breaking a lot of flows.
artpar··on A stateful browser agent using self-healing DOM maps
Ask the agent to make workflows for you.

You can use floating window or sidepanel also for the agent. New tab is just for convenience.

artpar··on A stateful browser agent using self-healing DOM maps
Worst case scenario we can just shut down sharing/public workflows altogether, or do you have something else in mind ?
artpar··on A stateful browser agent using self-healing DOM maps
One shot is pretty much not going to work, both at single step level or if you ask llm to generate workflow in one shot. We haven't measured it as such but even for static websites like hackernews front page it takes a couple tries of to and fro for the llm to get it right. somehow after all the instructions the llm will still "guess" the selector instead of checking the page/dom contents. And then there are lot of other minor details that need to be captured like "you need to wait a couple of second for the auto complete results to show up". If you tell it to just make a workflow, it will generate some garbage and call it a day.
artpar··on A stateful browser agent using self-healing DOM maps
I don't know if plywright works without chrome in debug mode, but I tried the MCP for chrome devtools and it requires chrome to be started in debugging mode and that basically means you cant log into a lot of sites (especially google) since it will block you with an "Unsafe" message. Works pretty well if you owe the target website.
artpar··on A stateful browser agent using self-healing DOM maps
So actually I have this setup (of a bridge server) which I use for agent4 itself (so claude code can talk to agent4), It makes a lot of sense to publish that bridge as well in the MCP form.
artpar··on A stateful browser agent using self-healing DOM maps
Yes I can imagine PI somehow being stored in the workflow. I frequently see llms hardcoding tests just to make user happy and this can also happen in the browser version where if something is too hard to scrape but agent is able to infer from screenshot so it might end up making a workflow that seems correct but is just hardcoded with data. We are thinking of multiple guards/blocks to not let user create such a workflow, but the risks that come with an open ended agent are still going to be present.
artpar··on A stateful browser agent using self-healing DOM maps
If I am reading you correctly, you captured the whole essence of agent4.

So it does the first pass (based on your goals) makes memories (and these are local)

Now you tell the agent you want to do this repeatedly, so it will make a workflow (these workflows are saved on server, currently all public for now but we are working out permissions/group based access) for you based on these memories and interactions.

The problem is many times that the agent thinks is stable isn't really, so there a feedback loop for the agent to test out the workflow and improve them. (its basically claude code/codex sitting in the browser)

Workflow details are appended to prompt based on user query match/opened tabs match.

artpar··on A stateful browser agent using self-healing DOM maps
Everyone thinks of typical e-commerce pages when its comes "browser agent doing something", but our real use cases are far from shopping for the user. But your point still stands valid. The idea is that maybe there are websites where generating stable selectors/hierarchy maps wouldn't solve, but 80% (from 80-20) of websites are not like that (including a lot of internal dashboard/interfaces) (there will also be issues for websites with proper i18n implementations if the selectors are aria label based)

Self healing css selectors is also only 1 part of the story. The other part is the cohesive interface for the agent itself to use these selectors.

artpar··on A stateful browser agent using self-healing DOM maps
So when you go into the "selector" mode, the plugin will add event listeners to all the DOM nodes. Based on your click it will try to generate a bunch of selectors statically first (multiple, css and xpath based), and then based on your guidance its the job of agent4 to make stable selectors.
artpar··on A stateful browser agent using self-healing DOM maps
Agent4 is going to store "stable selectors" that worked (when it performs a task first time most of the time is spent in identifying these css/xpath selectors). Memories are pretty straighforward at this point, they are stored locally in your browser's IndexedDB (you can inspect from chrome inspector).
artpar··on Ask HN: Best codebases to study to learn software design?
I made a small list long while ago, but it still holds today

https://medium.com/@012parth/what-source-code-is-worth-study...

artpar··on What to build instead of AI agents
claude doesn't read them reliably and has to be reminded across sessions. I ususally do @AGENT.main and @AGENT.knowledge and it figures out the rest. Over the period of doing this claude is able to maintain the "project management" part itself, as in terms of "whats the current state of the project" and "what are the next ideal todos and how to go about them".

> Can you provide any form of demonstration of an LLM reading these files and acting accordingly

claude does update them at the end of the session (i say wrap up on prompt). the ones you are seeing in that gist are original forms, they evolve with each commit.

artpar··on What to build instead of AI agents
I am using these files (most of them are llm generated based on my prompt to reduce its lookups when working on a codebase)

https://gist.github.com/artpar/60a3c1edfe752450e21547898e801...

(specially the AGENT.knowledge is quite helpful)

artpar··on Ask HN: As an eng leader, how useful is AI-generated internal documentation?
This is super amazing. I also go the "Failed to ..." etc error messages initially ( waited about 3-4 mins that time). Just checked once more after about 1 hour and it did generate the whole documentation.

Fairly readable and doesn't seem wrong ( havent gone in depth yet)

https://gitsummarize.com/daptin/daptin

artpar··on Goja: A Golang JavaScript Runtime
I am using otto[0] (similar to goja) in the headless cms I maintain [1] in "actions" api [2]. So one can customize actions according to needs by writing JS. The JS is executed inside a transaction. Sort of a mini-lambda kind of api

[0] https://github.com/robertkrimen/otto [1] https://github.com/daptin/daptin [2] https://daptin.github.io/docs/actions/actions/

artpar··on The Elements of APIs (2021)
If you like JSONAPI I maintain a 100% JSONAPI compliant headless cms

https://github.com/daptin/daptin

artpar··on Software galaxies
seems to be done in the same way, but the parameters are off. aswd (camera angle) + arrow keys(panning) works nicely when zoomed out but very sensitive when zoomed in.
artpar··on Show HN: Gosax – A high-performance SAX XML parser for Go
I upvoted you just because I made a golang library with the same name but different purpose

https://github.com/artpar/gosax/

its a High performance golang implementation of Symbolic Aggregate approXimation

artpar··on Show HN: Unlogged – open-source record and replay for Java
Hi I am Parth. Wanted to add a TLDR

unlogged-sdk => generates binary logs of code execution

unlogged intellij plugin => method level history, replay at method level, generate test cases

artpar··on Ask HN: Show me your half baked project
https://github.com/daptin/daptin
artpar··on Show HN: Speeding up the code-test cycle for Java developers
You can provide the classpath to the jshell (usually jshell -c target/classes) and with that jshell can locate your compiled classes.

But you will have to create the instances of your target class object (plus all of its dependencies) which is going to be really cumbersome.

Consider a Spring service class which uses another redis service and a database service and you want to call a method on this service. So now you have to create the redis service first (copy/paste their config values etc), then the database service and then the actual spring service you want to test.

Once you have created the service, now you need to create the parameter values required by your target method, which you would either create using a new Xyz(), variable.setX, setY and so on, or alternatively now try to import a JSON mapper (ok so now we need to add the classpath to the dependencies as well), and then reconstruct the parameter with objectMapper.readValueAsString("{json here}", Xyz.class);

You can see how this gets unnecessarily complicated depending on the project you are working with.

So with direct invoke you have all the class instances ready in the correct state and you can just call a function. The service classes are being setup by your start up procedure anyways. And for the parameters we are currently using the objectMapper approach so its all setup and ready to use.

artpar··on Show HN: Speeding up the code-test cycle for Java developers
Right, we are not doing anything in the hot reloading area. We are depending on either the jvm vendor provided hot reloading or jrebel
artpar··on Show HN: Speeding up the code-test cycle for Java developers
I have actually never used clojure repl, I'll check it out. How does it work with application code ? Or is it for Java SDK ?

I encourage you to give this a try, surely this should be less context switching if you are using intellij as your ide.

artpar··on Show HN: Speeding up the code-test cycle for Java developers
I just mentioned this in another response but will say this again, generating junit test cases is what we started doing in the first place.

We have still have that in the plugin. If you are interested I can share a custom build with that enabled for you to try it out. Just send me an email or ping us on the discord group.

We also have a boilerplate test case generator which uses dummy values, and this one you can use even without using the java agent. Its the first tab you will see in the plugin window after installing.

artpar··on Show HN: Speeding up the code-test cycle for Java developers
> I.e. what is wrong with Intellij's existing right click-execute on a single junit test method to debug and inspecting variables that way?

There is definitely nothing wrong with it if there are unit test cases available. But there is some extent of context switching in the current code-test cycle. And in the worst case scenario there are no test cases altogether and the team would rely on sanity testing + qa testing, eventually leading to some regressions on production. So you would be able to do the same thing with Atomic Run which you are doing currently with junit test cases but faster.

> Isn't this just reinventing the wheel and just replicating a built in IDE feature?

There is an overlap of functionality but no reinventing of wheel for sure. What we are trying to invent is construction of test cases itself without them being in the form of a junit test case (which is a maintenance overhead)

> Also this is seems to be unit testing, E2E (or to be precise "component") testing in my experience is what takes much longer and is where time is lost constructing the fixtures, but importantly E2E tells you if you've made stupid mistakes like using GET instead of POST, or have an XML serialiser overriding the JSON one you intended, which you don't pick up in unit tests.

So this is actually E2E testing and not unit testing because we don't have the capability of mocking down stream calls. If you do a Atomic Run on method1 which calls method2 and method3 on a different service, the method2/method3 would still be invoked and the outcome would depend on their response. Once we have the downstream mocking ready then it would be a unit test.

> Now if you could somehow save an entire VM stack/state of a system for E2E tests that wasn't brittle to code change, that could just rebuild that state with a single line of code, that would be my dream time saver. The closest I've seen anything like that is recording HTTP request responses or serialising individual Java objects to JSON and using those as fixtures...

Believe me this is what we started doing in the first place, and we have still have that in the plugin. It is just hidden from the UI since we received a mediocre response on generating junit test cases (maintenance headache). So we trimmed it down to the current form. If you are interested I can share a custom build with that enabled for you to try it out. Just send me an email or ping us on the discord group.

artpar··on Show HN: Speeding up the code-test cycle for Java developers
Yeah I understand what you mean when you say hot reloading is something that comes and goes. There are a variety of edge cases even though there is increasing support from the jvm vendors and also jrebel has been done a lot of work in that direction. We are trying to rely on those efforts for atomic run difference detectors. In our internal testing we figured that for method level changes even the default jvm vendor based hot reloading works to a great extent for most modern stacks (spring/dropwizard/play framework) .

About android, just want to point out that our current builds are not compatible with android since dalvik has different ways of working (register based) compared to desktop jvms (stack based)

artpar··on Show HN: Videobug – The time travel debugger for JVM
So from what I can make of it, this is very similar to what we are doing in terms of the goal.

The only difference which I am thinking here is (based on just their front page), seems they are recording only function parameters and return values. If that understanding is correct, videobug is recording down to local variable level data (so lets say if you return a list from a db query and iterate over it in your business logic function, you will be able to see execution inside the loop.

Also, in the FAQ, it says the pre-production/production env is likely to be years away. While we are very early, we are definitely aiming videobug in pre-production to begin with.

← PreviousPage 2 of 6Next →